@narrative.io/jsonforms-provider-protocols 1.1.0-beta.10 → 1.1.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vue/primevue/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,SAAS,MAAM,iBAAiB,CAAC;AA+BxC,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AA2BtE,eAAO,MAAM,iBAAiB,EAAE,8BAA8B,EAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vue/primevue/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,SAAS,MAAM,iBAAiB,CAAC;AA+BxC,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AA2BtE,eAAO,MAAM,iBAAiB,EAAE,8BAA8B,EAAO,CAAC;AA+CtE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -39,6 +39,7 @@ const isEnumArray = (s) => {
|
|
|
39
39
|
const PRIME = 100;
|
|
40
40
|
const primevueRenderers = [];
|
|
41
41
|
Promise.resolve().then(async () => {
|
|
42
|
+
const jsonformsCore = await import("@jsonforms/core");
|
|
42
43
|
const {
|
|
43
44
|
rankWith,
|
|
44
45
|
isStringControl,
|
|
@@ -49,7 +50,7 @@ Promise.resolve().then(async () => {
|
|
|
49
50
|
isControl,
|
|
50
51
|
schemaMatches,
|
|
51
52
|
isBooleanControl
|
|
52
|
-
} =
|
|
53
|
+
} = jsonformsCore;
|
|
53
54
|
const isMultilineString = (uischema, schema) => {
|
|
54
55
|
const controlUischema = uischema;
|
|
55
56
|
return and(isStringControl, () => controlUischema?.options?.multi === true)(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/vue/primevue/index.ts"],"sourcesContent":["import JfText from \"./JfText.vue\";\nimport JfTextArea from \"./JfTextArea.vue\";\nimport JfNumber from \"./JfNumber.vue\";\nimport JfEnum from \"./JfEnum.vue\";\nimport JfEnumArray from \"./JfEnumArray.vue\";\nimport JfBoolean from \"./JfBoolean.vue\";\n\n// Auto-inject layout styles\nconst injectLayoutStyles = () => {\n if (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n if (!document.getElementById(\"jsonforms-primevue-styles\")) {\n const style = document.createElement(\"style\");\n style.id = \"jsonforms-primevue-styles\";\n style.textContent = `\n/* JSONForms PrimeVue Provider Protocols Layout Styles */\n.vertical-layout {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 1rem;\n width: 100%;\n}\n\n.vertical-layout-item {\n width: 100%;\n}\n `;\n document.head.appendChild(style);\n }\n }\n};\n\n// Inject styles when this module is imported\ninjectLayoutStyles();\n\n// Import types only to avoid circular dependencies\nimport type { JsonFormsRendererRegistryEntry } from \"@jsonforms/core\";\n\n// helpers for enum detection\nconst isScalarEnum = (s?: object) => {\n const schema = s as { type?: string; enum?: unknown[]; oneOf?: unknown[] };\n return (\n schema &&\n schema.type !== \"array\" &&\n (Array.isArray(schema.enum) || Array.isArray(schema.oneOf))\n );\n};\n\nconst isEnumArray = (s?: object) => {\n const schema = s as {\n type?: string;\n items?: { enum?: unknown[]; oneOf?: unknown[] };\n };\n return (\n schema?.type === \"array\" &&\n (Array.isArray(schema.items?.enum) || Array.isArray(schema.items?.oneOf))\n );\n};\n\n// Give PrimeVue renderers a high base rank; vanilla commonly uses small ranks (2–5)\nconst PRIME = 100;\n\n// Create empty array first, populate it after module initialization to avoid circular deps\nexport const primevueRenderers: JsonFormsRendererRegistryEntry[] = [];\n\n// Populate the renderers array after a microtask delay to avoid circular dependency\nPromise.resolve().then(async () => {\n const {\n rankWith,\n isStringControl,\n or,\n isNumberControl,\n isIntegerControl,\n and,\n isControl,\n schemaMatches,\n isBooleanControl,\n } =
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/vue/primevue/index.ts"],"sourcesContent":["import JfText from \"./JfText.vue\";\nimport JfTextArea from \"./JfTextArea.vue\";\nimport JfNumber from \"./JfNumber.vue\";\nimport JfEnum from \"./JfEnum.vue\";\nimport JfEnumArray from \"./JfEnumArray.vue\";\nimport JfBoolean from \"./JfBoolean.vue\";\n\n// Auto-inject layout styles\nconst injectLayoutStyles = () => {\n if (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n if (!document.getElementById(\"jsonforms-primevue-styles\")) {\n const style = document.createElement(\"style\");\n style.id = \"jsonforms-primevue-styles\";\n style.textContent = `\n/* JSONForms PrimeVue Provider Protocols Layout Styles */\n.vertical-layout {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 1rem;\n width: 100%;\n}\n\n.vertical-layout-item {\n width: 100%;\n}\n `;\n document.head.appendChild(style);\n }\n }\n};\n\n// Inject styles when this module is imported\ninjectLayoutStyles();\n\n// Import types only to avoid circular dependencies\nimport type { JsonFormsRendererRegistryEntry } from \"@jsonforms/core\";\n\n// helpers for enum detection\nconst isScalarEnum = (s?: object) => {\n const schema = s as { type?: string; enum?: unknown[]; oneOf?: unknown[] };\n return (\n schema &&\n schema.type !== \"array\" &&\n (Array.isArray(schema.enum) || Array.isArray(schema.oneOf))\n );\n};\n\nconst isEnumArray = (s?: object) => {\n const schema = s as {\n type?: string;\n items?: { enum?: unknown[]; oneOf?: unknown[] };\n };\n return (\n schema?.type === \"array\" &&\n (Array.isArray(schema.items?.enum) || Array.isArray(schema.items?.oneOf))\n );\n};\n\n// Give PrimeVue renderers a high base rank; vanilla commonly uses small ranks (2–5)\nconst PRIME = 100;\n\n// Create empty array first, populate it after module initialization to avoid circular deps\nexport const primevueRenderers: JsonFormsRendererRegistryEntry[] = [];\n\n// Populate the renderers array after a microtask delay to avoid circular dependency\nPromise.resolve().then(async () => {\n const jsonformsCore = await import(\"@jsonforms/core\");\n const {\n rankWith,\n isStringControl,\n or,\n isNumberControl,\n isIntegerControl,\n and,\n isControl,\n schemaMatches,\n isBooleanControl,\n } = jsonformsCore;\n\n // helper for multiline detection moved inside async block\n const isMultilineString = (uischema: unknown, schema: unknown) => {\n const controlUischema = uischema as { options?: { multi?: boolean } };\n return and(isStringControl, () => controlUischema?.options?.multi === true)(\n uischema as Parameters<typeof isStringControl>[0],\n schema as Parameters<typeof isStringControl>[1],\n {} as Parameters<typeof isStringControl>[2],\n );\n };\n\n primevueRenderers.push(\n // Multiline text has higher priority than regular text\n { tester: rankWith(PRIME + 4, isMultilineString), renderer: JfTextArea },\n { tester: rankWith(PRIME + 3, isStringControl), renderer: JfText },\n {\n tester: rankWith(PRIME + 4, or(isNumberControl, isIntegerControl)),\n renderer: JfNumber,\n },\n {\n tester: rankWith(PRIME + 5, and(isControl, schemaMatches(isScalarEnum))),\n renderer: JfEnum,\n },\n {\n tester: rankWith(PRIME + 6, and(isControl, schemaMatches(isEnumArray))),\n renderer: JfEnumArray,\n },\n { tester: rankWith(PRIME + 3, isBooleanControl), renderer: JfBoolean },\n );\n});\n\nexport { JfText, JfTextArea, JfNumber, JfEnum, JfEnumArray, JfBoolean };\n"],"names":["JfTextArea","JfText","JfNumber","JfEnum","JfEnumArray","JfBoolean"],"mappings":";;;;;;AAQA,MAAM,qBAAqB,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C1D;AAAA,MACE,QAAQ,SAAS,QAAQ,GAAG,GAAG,iBAAiB,gBAAgB,CAAC;AAAA,MACjE,UAAUC;AAAAA,IAAA;AAAA,IAEZ;AAAA,MACE,QAAQ,SAAS,QAAQ,GAAG,IAAI,WAAW,cAAc,YAAY,CAAC,CAAC;AAAA,MACvE,UAAUC;AAAAA,IAAA;AAAA,IAEZ;AAAA,MACE,QAAQ,SAAS,QAAQ,GAAG,IAAI,WAAW,cAAc,WAAW,CAAC,CAAC;AAAA,MACtE,UAAUC;AAAAA,IAAA;AAAA,IAEZ,EAAE,QAAQ,SAAS,QAAQ,GAAG,gBAAgB,GAAG,UAAUC,YAAA;AAAA,EAAU;AAEzE,CAAC;"}
|
package/package.json
CHANGED
|
@@ -65,6 +65,7 @@ export const primevueRenderers: JsonFormsRendererRegistryEntry[] = [];
|
|
|
65
65
|
|
|
66
66
|
// Populate the renderers array after a microtask delay to avoid circular dependency
|
|
67
67
|
Promise.resolve().then(async () => {
|
|
68
|
+
const jsonformsCore = await import("@jsonforms/core");
|
|
68
69
|
const {
|
|
69
70
|
rankWith,
|
|
70
71
|
isStringControl,
|
|
@@ -75,7 +76,7 @@ Promise.resolve().then(async () => {
|
|
|
75
76
|
isControl,
|
|
76
77
|
schemaMatches,
|
|
77
78
|
isBooleanControl,
|
|
78
|
-
} =
|
|
79
|
+
} = jsonformsCore;
|
|
79
80
|
|
|
80
81
|
// helper for multiline detection moved inside async block
|
|
81
82
|
const isMultilineString = (uischema: unknown, schema: unknown) => {
|