Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,237 changes: 1,096 additions & 2,141 deletions package-lock.json

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"name": "@restspace/svelte-schema-form",
"name": "@playbyteinc/svelte-schema-form",
"version": "0.1.5",
"description": "JSON Schema based form generator in Svelte",
"author": "James Ellis-Jones",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/restspace/svelte-schema-form.git"
"url": "git+https://github.com/playbyteinc/svelte-schema-form.git"
},
"keywords": [
"svelte",
Expand All @@ -15,36 +18,33 @@
"json schema"
],
"bugs": {
"url": "https://github.com/restspace/svelte-schema-form/issues"
"url": "https://github.com/playbyteinc/svelte-schema-form/issues"
},
"homepage": "https://github.com/restspace/svelte-schema-form#readme",
"homepage": "https://github.com/playbyteinc/svelte-schema-form#readme",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"package": "svelte-kit package && sass package/css:package/css",
"build": "svelte-kit sync && svelte-package && sass package/css:package/css",
"prepublishOnly": "echo 'Did you mean to publish `./package/`, instead of `./`?' && exit 1",
"preview": "vite preview",
"prepare": "svelte-kit sync",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"copyout": "xcopy /s /y src\\lib ..\\svelte-schema-form-script\\svelte-schema-form\\src\\lib"
},
"devDependencies": {
"@sveltejs/adapter-auto": "next",
"@sveltejs/kit": "next",
"@sveltejs/adapter-auto": "^1.0.0",
"@sveltejs/kit": "^1.0.0",
"@sveltejs/package": "^1.0.0",
"@types/lodash-es": "^4.17.6",
"postcss-url": "^10.1.3",
"sass": "^1.53.0",
"svelte": "^3.44.0",
"svelte-check": "^2.7.1",
"svelte-preprocess": "^4.10.6",
"svelte-reactive-preprocessor": "^0.8.2",
"svelte2tsx": "^0.5.11",
"tslib": "^2.3.1",
"typescript": "^4.7.4",
"vite": "^3.0.0"
"sass": "^1.56.2",
"svelte": "^3.54.0",
"svelte-check": "^2.9.2",
"tslib": "^2.4.1",
"typescript": "^4.9.3",
"vite": "^4.0.0"
},
"dependencies": {
"@exodus/schemasafe": "^1.0.0-rc.7",
"@exodus/schemasafe": "^1.0.0-rc.9",
"lodash-es": "^4.17.21"
},
"type": "module"
Expand Down
4 changes: 2 additions & 2 deletions src/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
// for information about these interfaces
// and what to do when importing types
declare namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface Platform {}
// interface Session {}
// interface Stuff {}
}
5 changes: 2 additions & 3 deletions src/lib/SchemaForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
import String from "./editors/String.svelte";
import FieldWrapper from './editors/FieldWrapper.svelte';
import ObjectEditor from "./editors/Object.svelte";
import set from "lodash-es/set";
import get from "lodash-es/get";
import { set, get } from "lodash-es";
import { validator } from "@exodus/schemasafe";
import { FileNone, type CommonComponentParameters, type ValidationErrors } from './types/CommonComponentParameters';
import { FileNone, type CommonComponentParameters, type ValidationErrors } from './types/CommonComponentParameters.js';
import Enum from './editors/Enum.svelte';
import Array from './editors/Array.svelte';
import { incr, nullOptionalsAllowed } from './utilities';
Expand Down
4 changes: 2 additions & 2 deletions src/lib/SubSchemaForm.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import type { CommonComponentParameters } from "./types/CommonComponentParameters";
import { editorForSchema } from "./types/schema";
import type { CommonComponentParameters } from "./types/CommonComponentParameters.js";
import { editorForSchema } from "./types/schema.js";
export let params: CommonComponentParameters;
export let schema: any;
export let value: any;
Expand Down
6 changes: 3 additions & 3 deletions src/lib/SubmitForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<script lang="ts">
import SchemaForm from "./SchemaForm.svelte";
import { createEventDispatcher, setContext } from "svelte";
import { ProgressContext, type ValidationErrors } from "./types/CommonComponentParameters";
import { substituteProperties } from "./utilities";
import { ProgressContext, type ValidationErrors } from "./types/CommonComponentParameters.js";
import { substituteProperties } from "./utilities.js";
import { writable } from "svelte/store";
import set from "lodash-es/set";
import { set } from "lodash-es";

export let schema: any;
export let value: any;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/arrayOps.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CommonComponentParameters } from "./types/CommonComponentParameters";
import { emptyValue } from "./types/schema";
import type { CommonComponentParameters } from "./types/CommonComponentParameters.js";
import { emptyValue } from "./types/schema.js";

export const arrayAdd = (schema: any, params: CommonComponentParameters, value: any[]) => () => {
params.pathChanged(params.path,
Expand Down
8 changes: 4 additions & 4 deletions src/lib/editors/Array.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import type { CommonComponentParameters } from "../types/CommonComponentParameters";
import { emptyValue, schemaLabel } from "../types/schema";
import type { CommonComponentParameters } from "../types/CommonComponentParameters.js";
import { emptyValue, schemaLabel } from "../types/schema.js";
import SubSchemaForm from "../SubSchemaForm.svelte";
import { stringToHtml } from "../utilities";
import { arrayDelete, arrayAdd, arrayUp, arrayDown, arrayDuplicate } from "../arrayOps";
import { stringToHtml } from "../utilities.js";
import { arrayDelete, arrayAdd, arrayUp, arrayDown, arrayDuplicate } from "../arrayOps.js";
export let params: CommonComponentParameters;
export let schema: any;
export let value: any[];
Expand Down
6 changes: 3 additions & 3 deletions src/lib/editors/ArrayBlocks.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import type { CommonComponentParameters } from "../types/CommonComponentParameters";
import { emptyValue } from "../types/schema";
import type { CommonComponentParameters } from "../types/CommonComponentParameters.js";
import { emptyValue } from "../types/schema.js";
import SubSchemaForm from "../SubSchemaForm.svelte";
import _, { max } from "lodash-es";
import { pathCombine } from "../utilities";
import { pathCombine } from "../utilities.js";

export let params: CommonComponentParameters;
export let schema: any;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/editors/Autocomplete.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { select_options, tick } from "svelte/internal";
import type { CommonComponentParameters } from "../types/CommonComponentParameters";
import type { CommonComponentParameters } from "../types/CommonComponentParameters.js";

interface OptionVal {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/editors/Boolean.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { CommonComponentParameters } from "../types/CommonComponentParameters";
import type { CommonComponentParameters } from "../types/CommonComponentParameters.js";
export let params: CommonComponentParameters;
export let schema: any;
export let value: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/editors/Currency.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { editorForSchema } from "../types/schema";
import type { CommonComponentParameters } from "../types/CommonComponentParameters";
import { editorForSchema } from "../types/schema.js";
import type { CommonComponentParameters } from "../types/CommonComponentParameters.js";
export let params: CommonComponentParameters;
export let schema: any;
export let value: any;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/editors/Enum.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { CommonComponentParameters } from "../types/CommonComponentParameters";
import type { CommonComponentParameters } from "../types/CommonComponentParameters.js";
export let params: CommonComponentParameters;
export let schema: any;
export let value: any;
Expand Down
6 changes: 3 additions & 3 deletions src/lib/editors/FieldWrapper.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { schemaLabel } from "../types/schema";
import type { CommonComponentParameters } from "../types/CommonComponentParameters";
import { stringToHtml } from "../utilities";
import { schemaLabel } from "../types/schema.js";
import type { CommonComponentParameters } from "../types/CommonComponentParameters.js";
import { stringToHtml } from "../utilities.js";

export let params: CommonComponentParameters;
export let schema: any;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/editors/Hidden.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { CommonComponentParameters } from "../types/CommonComponentParameters";
import type { CommonComponentParameters } from "../types/CommonComponentParameters.js";
export let params: CommonComponentParameters;
export let schema: any;
export let value: any;
Expand Down
8 changes: 4 additions & 4 deletions src/lib/editors/ListDetail.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import type { CommonComponentParameters } from "../types/CommonComponentParameters";
import { emptyValue, schemaLabel } from "../types/schema";
import type { CommonComponentParameters } from "../types/CommonComponentParameters.js";
import { emptyValue, schemaLabel } from "../types/schema.js";
import SubSchemaForm from "../SubSchemaForm.svelte";
import { stringToHtml } from "../utilities";
import { arrayDelete, arrayAdd, arrayUp, arrayDown, arrayDuplicate } from "../arrayOps";
import { stringToHtml } from "../utilities.js";
import { arrayDelete, arrayAdd, arrayUp, arrayDown, arrayDuplicate } from "../arrayOps.js";
import { values } from "lodash-es";
import { tick } from "svelte";
export let params: CommonComponentParameters;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/editors/Number.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { CommonComponentParameters } from "../types/CommonComponentParameters";
import type { CommonComponentParameters } from "../types/CommonComponentParameters.js";
export let params: CommonComponentParameters;
export let schema: any;
export let value: any;
Expand Down
6 changes: 3 additions & 3 deletions src/lib/editors/Object.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">

import type { CommonComponentParameters } from "../types/CommonComponentParameters";
import type { CommonComponentParameters } from "../types/CommonComponentParameters.js";
import SubSchemaForm from "../SubSchemaForm.svelte";
import { schemaLabel } from "../types/schema";
import { stringToHtml } from "../utilities";
import { schemaLabel } from "../types/schema.js";
import { stringToHtml } from "../utilities.js";
export let params: CommonComponentParameters;
export let schema: any;
export let value: any;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/editors/Radio.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { CommonComponentParameters } from "../types/CommonComponentParameters";
import type { CommonComponentParameters } from "../types/CommonComponentParameters.js";
export let params: CommonComponentParameters;
export let schema: any;
export let value: any;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/editors/String.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { editorForSchema } from "../types/schema";
import type { CommonComponentParameters } from "../types/CommonComponentParameters";
import { editorForSchema } from "../types/schema.js";
import type { CommonComponentParameters } from "../types/CommonComponentParameters.js";
export let params: CommonComponentParameters;
export let schema: any;
export let value: any;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/editors/TextArea.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { CommonComponentParameters } from "../types/CommonComponentParameters";
import type { CommonComponentParameters } from "../types/CommonComponentParameters.js";
export let params: CommonComponentParameters;
export let schema: any;
export let value: any;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/editors/Upload.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts">
import { after, afterLast } from "../utilities";
import { after, afterLast } from "../utilities.js";

import { entries, keys } from "lodash-es";
import { getContext } from "svelte";
import type { Writable } from "svelte/store";
import { FileNone, ProgressContext, type CommonComponentParameters } from "../types/CommonComponentParameters";
import { FileNone, ProgressContext, type CommonComponentParameters } from "../types/CommonComponentParameters.js";
import Number from "./Number.svelte";
import String from "./String.svelte";

Expand Down
6 changes: 3 additions & 3 deletions src/lib/errorMapper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { get } from "@exodus/schemasafe/src/pointer";
import { jsonPointerToPath } from "./types/schema";
import { afterLast } from "./utilities";
import { get } from "@exodus/schemasafe/src/pointer.js";
import { jsonPointerToPath } from "./types/schema.js";
import { afterLast } from "./utilities.js";

export function errorMapper(schema: any, value: any, keywordLocation: string, instanceLocation: string): [ string, string ] {
const location = jsonPointerToPath(instanceLocation);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/schemasafe-extended.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module "@exodus/schemasafe/src/pointer" {
declare module "@exodus/schemasafe/src/pointer.js" {
let get: (obj: any, pointer: string, objpath?: string) => any;
export { get };
};
2 changes: 1 addition & 1 deletion src/lib/types/schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { camelToTitle } from "../utilities";
import { camelToTitle } from "../utilities.js";

export function editorForSchema(schema: any): string {
let type = schema['type'];
Expand Down
6 changes: 3 additions & 3 deletions src/routes/index.svelte → src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { SubmitForm } from "svelte-schema-form";
import "svelte-schema-form/css/layout.scss";
import "svelte-schema-form/css/basic-skin.scss";
import SubmitForm from "$lib/SubmitForm.svelte";
import "$lib/css/layout.scss";
import "$lib/css/basic-skin.scss";

let schema: any = {
type: "object",
Expand Down
12 changes: 4 additions & 8 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import adapter from '@sveltejs/adapter-auto';
import url from 'postcss-url';
import preprocess from 'svelte-preprocess';
import { vitePreprocess } from '@sveltejs/kit/vite';

/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: preprocess({
}),
preprocess: vitePreprocess(),

kit: {
adapter: adapter(),
package: {
}
adapter: adapter()
}
};

Expand Down
13 changes: 6 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"paths": {
"$lib":["src/lib"],
"$lib/*":["src/lib/*"],
"svelte-schema-form": [ "src/lib/index.ts" ],
"svelte-schema-form/*": [ "src/lib/*" ]
}
"moduleResolution": "NodeNext"
}
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
}
16 changes: 0 additions & 16 deletions vite.config.js

This file was deleted.

8 changes: 8 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { sveltekit } from '@sveltejs/kit/vite';
import type { UserConfig } from 'vite';

const config: UserConfig = {
plugins: [sveltekit()]
};

export default config;