@webiny/app-admin 6.2.0 → 6.3.0-beta.1

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.
Files changed (143) hide show
  1. package/base/Admin.js +2 -0
  2. package/base/Admin.js.map +1 -1
  3. package/base/Base/DefaultFieldRenderers.js +20 -4
  4. package/base/Base/DefaultFieldRenderers.js.map +1 -1
  5. package/base/Base/DefaultLayoutRenderers.d.ts +2 -0
  6. package/base/Base/DefaultLayoutRenderers.js +11 -0
  7. package/base/Base/DefaultLayoutRenderers.js.map +1 -0
  8. package/base/Base/FieldRenderers/InputRenderer.d.ts +15 -0
  9. package/base/Base/FieldRenderers/{TextRenderer.js → InputRenderer.js} +5 -3
  10. package/base/Base/FieldRenderers/InputRenderer.js.map +1 -0
  11. package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.d.ts +25 -0
  12. package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js +89 -0
  13. package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js.map +1 -0
  14. package/base/Base/FieldRenderers/ObjectRenderer/ObjectListFlatRenderer.d.ts +21 -0
  15. package/base/Base/FieldRenderers/ObjectRenderer/ObjectListFlatRenderer.js +28 -0
  16. package/base/Base/FieldRenderers/ObjectRenderer/ObjectListFlatRenderer.js.map +1 -0
  17. package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.d.ts +17 -0
  18. package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.js +63 -0
  19. package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.js.map +1 -0
  20. package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.d.ts +4 -0
  21. package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.js +22 -0
  22. package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.js.map +1 -0
  23. package/base/Base/FieldRenderers/PassthroughRenderer.d.ts +15 -0
  24. package/base/Base/FieldRenderers/PassthroughRenderer.js +29 -0
  25. package/base/Base/FieldRenderers/PassthroughRenderer.js.map +1 -0
  26. package/base/Base/FieldRenderers/SelectRenderer.d.ts +12 -2
  27. package/base/Base/FieldRenderers/SelectRenderer.js +4 -2
  28. package/base/Base/FieldRenderers/SelectRenderer.js.map +1 -1
  29. package/base/Base/FieldRenderers/TextareaRenderer.d.ts +17 -0
  30. package/base/Base/FieldRenderers/TextareaRenderer.js +25 -0
  31. package/base/Base/FieldRenderers/TextareaRenderer.js.map +1 -0
  32. package/base/Base/FieldRenderers/VerticalTabsRenderer.d.ts +5 -0
  33. package/base/Base/FieldRenderers/VerticalTabsRenderer.js +41 -0
  34. package/base/Base/FieldRenderers/VerticalTabsRenderer.js.map +1 -0
  35. package/base/Base.js +2 -1
  36. package/base/Base.js.map +1 -1
  37. package/base/createRootContainer.js +4 -0
  38. package/base/createRootContainer.js.map +1 -1
  39. package/base/providers/UiProviders.js +0 -1
  40. package/base/providers/UiProviders.js.map +1 -1
  41. package/components/Filters/Filters.js.map +1 -1
  42. package/components/IconPicker/components/IconPickerCell.d.ts +1 -1
  43. package/components/IconPicker/components/IconPickerTrigger.d.ts +1 -1
  44. package/components/IconPicker/components/IconPickerTrigger.js.map +1 -1
  45. package/components/LexicalEditor/LexicalEditor.js +7 -1
  46. package/components/LexicalEditor/LexicalEditor.js.map +1 -1
  47. package/components/LexicalEditor/lexicalValueFromHtml.d.ts +7 -0
  48. package/components/LexicalEditor/lexicalValueFromHtml.js +35 -0
  49. package/components/LexicalEditor/lexicalValueFromHtml.js.map +1 -0
  50. package/components/OverlayLayout/components/OverlayHeader.d.ts +1 -1
  51. package/components/OverlayLayout/components/OverlayHeader.js.map +1 -1
  52. package/components/SimpleForm/SimpleForm.d.ts +2 -2
  53. package/components/SimpleForm/SimpleForm.js.map +1 -1
  54. package/config/AdminConfig/Form.d.ts +1 -0
  55. package/config/AdminConfig/Form.js +3 -1
  56. package/config/AdminConfig/Form.js.map +1 -1
  57. package/config/AdminConfig/LayoutRenderer.d.ts +10 -0
  58. package/config/AdminConfig/LayoutRenderer.js +21 -0
  59. package/config/AdminConfig/LayoutRenderer.js.map +1 -0
  60. package/config/AdminConfig/Menu/MenuLink.d.ts +2 -2
  61. package/config/AdminConfig.d.ts +4 -0
  62. package/config/AdminConfig.js +2 -1
  63. package/config/AdminConfig.js.map +1 -1
  64. package/exports/admin.d.ts +2 -0
  65. package/exports/admin.js +2 -0
  66. package/exports/admin.js.map +1 -1
  67. package/features/formModel/Field.js +4 -0
  68. package/features/formModel/Field.js.map +1 -1
  69. package/features/formModel/FieldBuilder.d.ts +18 -2
  70. package/features/formModel/FieldBuilder.js +57 -3
  71. package/features/formModel/FieldBuilder.js.map +1 -1
  72. package/features/formModel/FormModel.d.ts +3 -3
  73. package/features/formModel/FormModel.js +48 -13
  74. package/features/formModel/FormModel.js.map +1 -1
  75. package/features/formModel/FormModel.test.js +383 -0
  76. package/features/formModel/FormModel.test.js.map +1 -1
  77. package/features/formModel/FormModelFactory.d.ts +2 -2
  78. package/features/formModel/FormModelFactory.js.map +1 -1
  79. package/features/formModel/FormView.d.ts +24 -4
  80. package/features/formModel/FormView.js +57 -27
  81. package/features/formModel/FormView.js.map +1 -1
  82. package/features/formModel/ObjectField.d.ts +46 -0
  83. package/features/formModel/ObjectField.js +346 -0
  84. package/features/formModel/ObjectField.js.map +1 -0
  85. package/features/formModel/abstractions.d.ts +88 -19
  86. package/features/formModel/abstractions.js +8 -0
  87. package/features/formModel/abstractions.js.map +1 -1
  88. package/features/formModel/index.d.ts +7 -4
  89. package/features/formModel/index.js +9 -2
  90. package/features/formModel/index.js.map +1 -1
  91. package/features/formModel/renderers.d.ts +6 -0
  92. package/features/formModel/renderers.js +10 -0
  93. package/features/formModel/renderers.js.map +1 -0
  94. package/features/formModel/useLayoutRenderers.d.ts +2 -0
  95. package/features/formModel/useLayoutRenderers.js +19 -0
  96. package/features/formModel/useLayoutRenderers.js.map +1 -0
  97. package/features/tools/ToolPipelineRunner.d.ts +10 -0
  98. package/features/tools/ToolPipelineRunner.js +33 -0
  99. package/features/tools/ToolPipelineRunner.js.map +1 -0
  100. package/features/tools/ToolRegistry.d.ts +12 -0
  101. package/features/tools/ToolRegistry.js +29 -0
  102. package/features/tools/ToolRegistry.js.map +1 -0
  103. package/features/tools/abstractions.d.ts +28 -0
  104. package/features/tools/abstractions.js +6 -0
  105. package/features/tools/abstractions.js.map +1 -0
  106. package/features/tools/feature.d.ts +4 -0
  107. package/features/tools/feature.js +19 -0
  108. package/features/tools/feature.js.map +1 -0
  109. package/features/tools/index.d.ts +2 -0
  110. package/features/tools/index.js +4 -0
  111. package/features/tools/index.js.map +1 -0
  112. package/features/wcp/ReactLicense.d.ts +3 -0
  113. package/features/wcp/ReactLicense.js +9 -0
  114. package/features/wcp/ReactLicense.js.map +1 -1
  115. package/features/wcp/WcpGateway.js +4 -0
  116. package/features/wcp/WcpGateway.js.map +1 -1
  117. package/features/webinySdk/WebinySdk.d.ts +11 -0
  118. package/features/webinySdk/WebinySdk.js +27 -0
  119. package/features/webinySdk/WebinySdk.js.map +1 -0
  120. package/features/webinySdk/abstractions.d.ts +6 -0
  121. package/features/webinySdk/abstractions.js +8 -0
  122. package/features/webinySdk/abstractions.js.map +1 -0
  123. package/features/webinySdk/feature.d.ts +3 -0
  124. package/features/webinySdk/feature.js +16 -0
  125. package/features/webinySdk/feature.js.map +1 -0
  126. package/features/webinySdk/index.d.ts +2 -0
  127. package/features/webinySdk/index.js +4 -0
  128. package/features/webinySdk/index.js.map +1 -0
  129. package/index.d.ts +8 -3
  130. package/index.js +5 -2
  131. package/index.js.map +1 -1
  132. package/package.json +24 -23
  133. package/presentation/textToLexicalTool/TextToLexicalTool.d.ts +27 -0
  134. package/presentation/textToLexicalTool/TextToLexicalTool.js +25 -0
  135. package/presentation/textToLexicalTool/TextToLexicalTool.js.map +1 -0
  136. package/presentation/textToLexicalTool/feature.d.ts +1 -0
  137. package/presentation/textToLexicalTool/feature.js +10 -0
  138. package/presentation/textToLexicalTool/feature.js.map +1 -0
  139. package/presentation/textToLexicalTool/textToLexicalState.d.ts +5 -0
  140. package/presentation/textToLexicalTool/textToLexicalState.js +19 -0
  141. package/presentation/textToLexicalTool/textToLexicalState.js.map +1 -0
  142. package/base/Base/FieldRenderers/TextRenderer.d.ts +0 -5
  143. package/base/Base/FieldRenderers/TextRenderer.js.map +0 -1
@@ -0,0 +1,28 @@
1
+ import type { z } from "zod";
2
+ export interface ITool<TInput extends z.ZodType = z.ZodType, TOutput extends z.ZodType = z.ZodType> {
3
+ name: string;
4
+ description: string;
5
+ inputSchema: TInput;
6
+ outputSchema: TOutput;
7
+ execute(input: z.infer<TInput>): Promise<z.infer<TOutput>>;
8
+ }
9
+ export declare const Tool: import("@webiny/di").Abstraction<ITool<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
10
+ export declare namespace Tool {
11
+ type Interface<TInput extends z.ZodType = z.ZodType, TOutput extends z.ZodType = z.ZodType> = ITool<TInput, TOutput>;
12
+ }
13
+ export interface IToolRegistry {
14
+ getTool(name: string): ITool;
15
+ getTools(): ITool[];
16
+ invoke(name: string, params: unknown): Promise<unknown>;
17
+ }
18
+ export declare const ToolRegistry: import("@webiny/di").Abstraction<IToolRegistry>;
19
+ export declare namespace ToolRegistry {
20
+ type Interface = IToolRegistry;
21
+ }
22
+ export interface IToolPipelineRunner {
23
+ resolve(data: unknown): Promise<unknown>;
24
+ }
25
+ export declare const ToolPipelineRunner: import("@webiny/di").Abstraction<IToolPipelineRunner>;
26
+ export declare namespace ToolPipelineRunner {
27
+ type Interface = IToolPipelineRunner;
28
+ }
@@ -0,0 +1,6 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ export const Tool = createAbstraction("Tool");
3
+ export const ToolRegistry = createAbstraction("ToolRegistry");
4
+ export const ToolPipelineRunner = createAbstraction("ToolPipelineRunner");
5
+
6
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createAbstraction","Tool","ToolRegistry","ToolPipelineRunner"],"sources":["abstractions.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport { createAbstraction } from \"@webiny/feature/admin\";\n\nexport interface ITool<\n TInput extends z.ZodType = z.ZodType,\n TOutput extends z.ZodType = z.ZodType\n> {\n name: string;\n description: string;\n inputSchema: TInput;\n outputSchema: TOutput;\n execute(input: z.infer<TInput>): Promise<z.infer<TOutput>>;\n}\n\nexport const Tool = createAbstraction<ITool>(\"Tool\");\n\nexport namespace Tool {\n export type Interface<\n TInput extends z.ZodType = z.ZodType,\n TOutput extends z.ZodType = z.ZodType\n > = ITool<TInput, TOutput>;\n}\n\nexport interface IToolRegistry {\n getTool(name: string): ITool;\n getTools(): ITool[];\n invoke(name: string, params: unknown): Promise<unknown>;\n}\n\nexport const ToolRegistry = createAbstraction<IToolRegistry>(\"ToolRegistry\");\n\nexport namespace ToolRegistry {\n export type Interface = IToolRegistry;\n}\n\nexport interface IToolPipelineRunner {\n resolve(data: unknown): Promise<unknown>;\n}\n\nexport const ToolPipelineRunner = createAbstraction<IToolPipelineRunner>(\"ToolPipelineRunner\");\n\nexport namespace ToolPipelineRunner {\n export type Interface = IToolPipelineRunner;\n}\n"],"mappings":"AACA,SAASA,iBAAiB,QAAQ,uBAAuB;AAazD,OAAO,MAAMC,IAAI,GAAGD,iBAAiB,CAAQ,MAAM,CAAC;AAepD,OAAO,MAAME,YAAY,GAAGF,iBAAiB,CAAgB,cAAc,CAAC;AAU5E,OAAO,MAAMG,kBAAkB,GAAGH,iBAAiB,CAAsB,oBAAoB,CAAC","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ export declare const ToolsFeature: import("@webiny/feature/admin").FeatureDefinition<{
2
+ toolRegistry: import("./abstractions.js").IToolRegistry;
3
+ pipelineRunner: import("./abstractions.js").IToolPipelineRunner;
4
+ }, []>;
@@ -0,0 +1,19 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { ToolRegistry as ToolRegistryAbstraction, ToolPipelineRunner as PipelineRunnerAbstraction } from "./abstractions.js";
3
+ import { ToolRegistry } from "./ToolRegistry.js";
4
+ import { ToolPipelineRunner } from "./ToolPipelineRunner.js";
5
+ export const ToolsFeature = createFeature({
6
+ name: "ToolsFeature",
7
+ register(container) {
8
+ container.register(ToolRegistry);
9
+ container.register(ToolPipelineRunner);
10
+ },
11
+ resolve(container) {
12
+ return {
13
+ toolRegistry: container.resolve(ToolRegistryAbstraction),
14
+ pipelineRunner: container.resolve(PipelineRunnerAbstraction)
15
+ };
16
+ }
17
+ });
18
+
19
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createFeature","ToolRegistry","ToolRegistryAbstraction","ToolPipelineRunner","PipelineRunnerAbstraction","ToolsFeature","name","register","container","resolve","toolRegistry","pipelineRunner"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { Container } from \"@webiny/di\";\nimport {\n ToolRegistry as ToolRegistryAbstraction,\n ToolPipelineRunner as PipelineRunnerAbstraction\n} from \"./abstractions.js\";\nimport { ToolRegistry } from \"./ToolRegistry.js\";\nimport { ToolPipelineRunner } from \"./ToolPipelineRunner.js\";\n\nexport const ToolsFeature = createFeature({\n name: \"ToolsFeature\",\n register(container: Container) {\n container.register(ToolRegistry);\n container.register(ToolPipelineRunner);\n },\n resolve(container: Container) {\n return {\n toolRegistry: container.resolve(ToolRegistryAbstraction),\n pipelineRunner: container.resolve(PipelineRunnerAbstraction)\n };\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,uBAAuB;AAErD,SACIC,YAAY,IAAIC,uBAAuB,EACvCC,kBAAkB,IAAIC,yBAAyB;AAEnD,SAASH,YAAY;AACrB,SAASE,kBAAkB;AAE3B,OAAO,MAAME,YAAY,GAAGL,aAAa,CAAC;EACtCM,IAAI,EAAE,cAAc;EACpBC,QAAQA,CAACC,SAAoB,EAAE;IAC3BA,SAAS,CAACD,QAAQ,CAACN,YAAY,CAAC;IAChCO,SAAS,CAACD,QAAQ,CAACJ,kBAAkB,CAAC;EAC1C,CAAC;EACDM,OAAOA,CAACD,SAAoB,EAAE;IAC1B,OAAO;MACHE,YAAY,EAAEF,SAAS,CAACC,OAAO,CAACP,uBAAuB,CAAC;MACxDS,cAAc,EAAEH,SAAS,CAACC,OAAO,CAACL,yBAAyB;IAC/D,CAAC;EACL;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export { Tool, ToolRegistry, ToolPipelineRunner } from "./abstractions.js";
2
+ export { ToolsFeature } from "./feature.js";
@@ -0,0 +1,4 @@
1
+ export { Tool, ToolRegistry, ToolPipelineRunner } from "./abstractions.js";
2
+ export { ToolsFeature } from "./feature.js";
3
+
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Tool","ToolRegistry","ToolPipelineRunner","ToolsFeature"],"sources":["index.ts"],"sourcesContent":["export { Tool, ToolRegistry, ToolPipelineRunner } from \"./abstractions.js\";\nexport { ToolsFeature } from \"./feature.js\";\n"],"mappings":"AAAA,SAASA,IAAI,EAAEC,YAAY,EAAEC,kBAAkB;AAC/C,SAASC,YAAY","ignoreList":[]}
@@ -15,5 +15,8 @@ export declare class ReactLicense implements ILicense {
15
15
  canUseTeams(): boolean;
16
16
  getRawLicense(): DecryptedWcpProjectLicense | null;
17
17
  canUseWorkflows(): boolean;
18
+ canUseAiImageEnrichment(): boolean;
19
+ canUseAiPageGeneration(): boolean;
20
+ canUseAiLexicalGeneration(): boolean;
18
21
  toDto(): DecryptedWcpProjectLicense | null;
19
22
  }
@@ -38,6 +38,15 @@ export class ReactLicense {
38
38
  canUseWorkflows() {
39
39
  return this.license.canUseWorkflows();
40
40
  }
41
+ canUseAiImageEnrichment() {
42
+ return this.license.canUseAiImageEnrichment();
43
+ }
44
+ canUseAiPageGeneration() {
45
+ return this.license.canUseAiPageGeneration();
46
+ }
47
+ canUseAiLexicalGeneration() {
48
+ return this.license.canUseAiLexicalGeneration();
49
+ }
41
50
  toDto() {
42
51
  return this.license.toDto();
43
52
  }
@@ -1 +1 @@
1
- {"version":3,"names":["ReactLicense","constructor","license","getProject","canUseAacl","canUseAuditLogs","canUseFeature","featureId","canUseFileManagerThreatDetection","canUseFolderLevelPermissions","canUseHcmsFieldPermissions","canUsePrivateFiles","canUseRecordLocking","canUseTeams","getRawLicense","canUseWorkflows","toDto"],"sources":["ReactLicense.ts"],"sourcesContent":["import type { DecryptedWcpProjectLicense, ILicense, WcpProject } from \"@webiny/wcp/types.js\";\nimport type { WCP_FEATURE_LABEL } from \"@webiny/wcp\";\n\nexport class ReactLicense implements ILicense {\n private readonly license: ILicense;\n\n constructor(license: ILicense) {\n this.license = license;\n }\n\n getProject(): WcpProject | null {\n return this.license.getProject();\n }\n\n canUseAacl(): boolean {\n return this.license.canUseAacl();\n }\n\n canUseAuditLogs(): boolean {\n return this.license.canUseAuditLogs();\n }\n\n canUseFeature(featureId: keyof typeof WCP_FEATURE_LABEL): boolean {\n return this.license.canUseFeature(featureId);\n }\n\n canUseFileManagerThreatDetection(): boolean {\n return this.license.canUseFileManagerThreatDetection();\n }\n\n canUseFolderLevelPermissions(): boolean {\n return this.license.canUseFolderLevelPermissions();\n }\n\n canUseHcmsFieldPermissions(): boolean {\n return this.license.canUseHcmsFieldPermissions();\n }\n\n canUsePrivateFiles(): boolean {\n return this.license.canUsePrivateFiles();\n }\n\n canUseRecordLocking(): boolean {\n return this.license.canUseRecordLocking();\n }\n\n canUseTeams(): boolean {\n return this.license.canUseTeams();\n }\n\n getRawLicense(): DecryptedWcpProjectLicense | null {\n return this.license.getRawLicense();\n }\n\n public canUseWorkflows(): boolean {\n return this.license.canUseWorkflows();\n }\n\n toDto(): DecryptedWcpProjectLicense | null {\n return this.license.toDto();\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,YAAY,CAAqB;EAG1CC,WAAWA,CAACC,OAAiB,EAAE;IAC3B,IAAI,CAACA,OAAO,GAAGA,OAAO;EAC1B;EAEAC,UAAUA,CAAA,EAAsB;IAC5B,OAAO,IAAI,CAACD,OAAO,CAACC,UAAU,CAAC,CAAC;EACpC;EAEAC,UAAUA,CAAA,EAAY;IAClB,OAAO,IAAI,CAACF,OAAO,CAACE,UAAU,CAAC,CAAC;EACpC;EAEAC,eAAeA,CAAA,EAAY;IACvB,OAAO,IAAI,CAACH,OAAO,CAACG,eAAe,CAAC,CAAC;EACzC;EAEAC,aAAaA,CAACC,SAAyC,EAAW;IAC9D,OAAO,IAAI,CAACL,OAAO,CAACI,aAAa,CAACC,SAAS,CAAC;EAChD;EAEAC,gCAAgCA,CAAA,EAAY;IACxC,OAAO,IAAI,CAACN,OAAO,CAACM,gCAAgC,CAAC,CAAC;EAC1D;EAEAC,4BAA4BA,CAAA,EAAY;IACpC,OAAO,IAAI,CAACP,OAAO,CAACO,4BAA4B,CAAC,CAAC;EACtD;EAEAC,0BAA0BA,CAAA,EAAY;IAClC,OAAO,IAAI,CAACR,OAAO,CAACQ,0BAA0B,CAAC,CAAC;EACpD;EAEAC,kBAAkBA,CAAA,EAAY;IAC1B,OAAO,IAAI,CAACT,OAAO,CAACS,kBAAkB,CAAC,CAAC;EAC5C;EAEAC,mBAAmBA,CAAA,EAAY;IAC3B,OAAO,IAAI,CAACV,OAAO,CAACU,mBAAmB,CAAC,CAAC;EAC7C;EAEAC,WAAWA,CAAA,EAAY;IACnB,OAAO,IAAI,CAACX,OAAO,CAACW,WAAW,CAAC,CAAC;EACrC;EAEAC,aAAaA,CAAA,EAAsC;IAC/C,OAAO,IAAI,CAACZ,OAAO,CAACY,aAAa,CAAC,CAAC;EACvC;EAEOC,eAAeA,CAAA,EAAY;IAC9B,OAAO,IAAI,CAACb,OAAO,CAACa,eAAe,CAAC,CAAC;EACzC;EAEAC,KAAKA,CAAA,EAAsC;IACvC,OAAO,IAAI,CAACd,OAAO,CAACc,KAAK,CAAC,CAAC;EAC/B;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["ReactLicense","constructor","license","getProject","canUseAacl","canUseAuditLogs","canUseFeature","featureId","canUseFileManagerThreatDetection","canUseFolderLevelPermissions","canUseHcmsFieldPermissions","canUsePrivateFiles","canUseRecordLocking","canUseTeams","getRawLicense","canUseWorkflows","canUseAiImageEnrichment","canUseAiPageGeneration","canUseAiLexicalGeneration","toDto"],"sources":["ReactLicense.ts"],"sourcesContent":["import type { DecryptedWcpProjectLicense, ILicense, WcpProject } from \"@webiny/wcp/types.js\";\nimport type { WCP_FEATURE_LABEL } from \"@webiny/wcp\";\n\nexport class ReactLicense implements ILicense {\n private readonly license: ILicense;\n\n constructor(license: ILicense) {\n this.license = license;\n }\n\n getProject(): WcpProject | null {\n return this.license.getProject();\n }\n\n canUseAacl(): boolean {\n return this.license.canUseAacl();\n }\n\n canUseAuditLogs(): boolean {\n return this.license.canUseAuditLogs();\n }\n\n canUseFeature(featureId: keyof typeof WCP_FEATURE_LABEL): boolean {\n return this.license.canUseFeature(featureId);\n }\n\n canUseFileManagerThreatDetection(): boolean {\n return this.license.canUseFileManagerThreatDetection();\n }\n\n canUseFolderLevelPermissions(): boolean {\n return this.license.canUseFolderLevelPermissions();\n }\n\n canUseHcmsFieldPermissions(): boolean {\n return this.license.canUseHcmsFieldPermissions();\n }\n\n canUsePrivateFiles(): boolean {\n return this.license.canUsePrivateFiles();\n }\n\n canUseRecordLocking(): boolean {\n return this.license.canUseRecordLocking();\n }\n\n canUseTeams(): boolean {\n return this.license.canUseTeams();\n }\n\n getRawLicense(): DecryptedWcpProjectLicense | null {\n return this.license.getRawLicense();\n }\n\n public canUseWorkflows(): boolean {\n return this.license.canUseWorkflows();\n }\n\n canUseAiImageEnrichment(): boolean {\n return this.license.canUseAiImageEnrichment();\n }\n\n canUseAiPageGeneration(): boolean {\n return this.license.canUseAiPageGeneration();\n }\n\n canUseAiLexicalGeneration(): boolean {\n return this.license.canUseAiLexicalGeneration();\n }\n\n toDto(): DecryptedWcpProjectLicense | null {\n return this.license.toDto();\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,YAAY,CAAqB;EAG1CC,WAAWA,CAACC,OAAiB,EAAE;IAC3B,IAAI,CAACA,OAAO,GAAGA,OAAO;EAC1B;EAEAC,UAAUA,CAAA,EAAsB;IAC5B,OAAO,IAAI,CAACD,OAAO,CAACC,UAAU,CAAC,CAAC;EACpC;EAEAC,UAAUA,CAAA,EAAY;IAClB,OAAO,IAAI,CAACF,OAAO,CAACE,UAAU,CAAC,CAAC;EACpC;EAEAC,eAAeA,CAAA,EAAY;IACvB,OAAO,IAAI,CAACH,OAAO,CAACG,eAAe,CAAC,CAAC;EACzC;EAEAC,aAAaA,CAACC,SAAyC,EAAW;IAC9D,OAAO,IAAI,CAACL,OAAO,CAACI,aAAa,CAACC,SAAS,CAAC;EAChD;EAEAC,gCAAgCA,CAAA,EAAY;IACxC,OAAO,IAAI,CAACN,OAAO,CAACM,gCAAgC,CAAC,CAAC;EAC1D;EAEAC,4BAA4BA,CAAA,EAAY;IACpC,OAAO,IAAI,CAACP,OAAO,CAACO,4BAA4B,CAAC,CAAC;EACtD;EAEAC,0BAA0BA,CAAA,EAAY;IAClC,OAAO,IAAI,CAACR,OAAO,CAACQ,0BAA0B,CAAC,CAAC;EACpD;EAEAC,kBAAkBA,CAAA,EAAY;IAC1B,OAAO,IAAI,CAACT,OAAO,CAACS,kBAAkB,CAAC,CAAC;EAC5C;EAEAC,mBAAmBA,CAAA,EAAY;IAC3B,OAAO,IAAI,CAACV,OAAO,CAACU,mBAAmB,CAAC,CAAC;EAC7C;EAEAC,WAAWA,CAAA,EAAY;IACnB,OAAO,IAAI,CAACX,OAAO,CAACW,WAAW,CAAC,CAAC;EACrC;EAEAC,aAAaA,CAAA,EAAsC;IAC/C,OAAO,IAAI,CAACZ,OAAO,CAACY,aAAa,CAAC,CAAC;EACvC;EAEOC,eAAeA,CAAA,EAAY;IAC9B,OAAO,IAAI,CAACb,OAAO,CAACa,eAAe,CAAC,CAAC;EACzC;EAEAC,uBAAuBA,CAAA,EAAY;IAC/B,OAAO,IAAI,CAACd,OAAO,CAACc,uBAAuB,CAAC,CAAC;EACjD;EAEAC,sBAAsBA,CAAA,EAAY;IAC9B,OAAO,IAAI,CAACf,OAAO,CAACe,sBAAsB,CAAC,CAAC;EAChD;EAEAC,yBAAyBA,CAAA,EAAY;IACjC,OAAO,IAAI,CAAChB,OAAO,CAACgB,yBAAyB,CAAC,CAAC;EACnD;EAEAC,KAAKA,CAAA,EAAsC;IACvC,OAAO,IAAI,CAACjB,OAAO,CAACiB,KAAK,CAAC,CAAC;EAC/B;AACJ","ignoreList":[]}
@@ -35,6 +35,10 @@ const GET_WCP_PROJECT = /* GraphQL */`
35
35
  enabled
36
36
  options
37
37
  }
38
+ aiPowerups {
39
+ enabled
40
+ options
41
+ }
38
42
  }
39
43
  }
40
44
  }
@@ -1 +1 @@
1
- {"version":3,"names":["createImplementation","WcpGateway","WcpGatewayAbstraction","MainGraphQLClient","GET_WCP_PROJECT","WcpGraphQLGateway","constructor","client","fetchProject","response","execute","query","headers","wcp","getProject","error","Error","message","data","abstraction","implementation","dependencies"],"sources":["WcpGateway.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { WcpGateway as WcpGatewayAbstraction } from \"./abstractions.js\";\nimport { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/index.js\";\nimport type { GetWcpProjectResponse, WcpProjectData } from \"./types.js\";\n\nconst GET_WCP_PROJECT = /* GraphQL */ `\n query GetWcpProject {\n wcp {\n getProject {\n data {\n orgId\n projectId\n package {\n features {\n seats {\n enabled\n options\n }\n multiTenancy {\n enabled\n options\n }\n advancedPublishingWorkflow {\n enabled\n }\n advancedAccessControlLayer {\n enabled\n options\n }\n auditLogs {\n enabled\n }\n recordLocking {\n enabled\n }\n fileManager {\n enabled\n options\n }\n }\n }\n }\n error {\n message\n code\n data\n }\n }\n }\n }\n`;\n\nclass WcpGraphQLGateway implements WcpGatewayAbstraction.Interface {\n constructor(private client: MainGraphQLClient.Interface) {}\n\n async fetchProject(): Promise<WcpProjectData | null> {\n const response = await this.client.execute<GetWcpProjectResponse>({\n query: GET_WCP_PROJECT,\n headers: {\n \"x-tenant\": \"root\"\n }\n });\n\n if (response.wcp.getProject.error) {\n throw new Error(response.wcp.getProject.error.message);\n }\n\n return response.wcp.getProject.data;\n }\n}\n\nexport const WcpGateway = createImplementation({\n abstraction: WcpGatewayAbstraction,\n implementation: WcpGraphQLGateway,\n dependencies: [MainGraphQLClient]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,UAAU,IAAIC,qBAAqB;AAC5C,SAASC,iBAAiB,QAAQ,iDAAiD;AAGnF,MAAMC,eAAe,GAAG,aAAc;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,MAAMC,iBAAiB,CAA4C;EAC/DC,WAAWA,CAASC,MAAmC,EAAE;IAAA,KAArCA,MAAmC,GAAnCA,MAAmC;EAAG;EAE1D,MAAMC,YAAYA,CAAA,EAAmC;IACjD,MAAMC,QAAQ,GAAG,MAAM,IAAI,CAACF,MAAM,CAACG,OAAO,CAAwB;MAC9DC,KAAK,EAAEP,eAAe;MACtBQ,OAAO,EAAE;QACL,UAAU,EAAE;MAChB;IACJ,CAAC,CAAC;IAEF,IAAIH,QAAQ,CAACI,GAAG,CAACC,UAAU,CAACC,KAAK,EAAE;MAC/B,MAAM,IAAIC,KAAK,CAACP,QAAQ,CAACI,GAAG,CAACC,UAAU,CAACC,KAAK,CAACE,OAAO,CAAC;IAC1D;IAEA,OAAOR,QAAQ,CAACI,GAAG,CAACC,UAAU,CAACI,IAAI;EACvC;AACJ;AAEA,OAAO,MAAMjB,UAAU,GAAGD,oBAAoB,CAAC;EAC3CmB,WAAW,EAAEjB,qBAAqB;EAClCkB,cAAc,EAAEf,iBAAiB;EACjCgB,YAAY,EAAE,CAAClB,iBAAiB;AACpC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createImplementation","WcpGateway","WcpGatewayAbstraction","MainGraphQLClient","GET_WCP_PROJECT","WcpGraphQLGateway","constructor","client","fetchProject","response","execute","query","headers","wcp","getProject","error","Error","message","data","abstraction","implementation","dependencies"],"sources":["WcpGateway.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { WcpGateway as WcpGatewayAbstraction } from \"./abstractions.js\";\nimport { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/index.js\";\nimport type { GetWcpProjectResponse, WcpProjectData } from \"./types.js\";\n\nconst GET_WCP_PROJECT = /* GraphQL */ `\n query GetWcpProject {\n wcp {\n getProject {\n data {\n orgId\n projectId\n package {\n features {\n seats {\n enabled\n options\n }\n multiTenancy {\n enabled\n options\n }\n advancedPublishingWorkflow {\n enabled\n }\n advancedAccessControlLayer {\n enabled\n options\n }\n auditLogs {\n enabled\n }\n recordLocking {\n enabled\n }\n fileManager {\n enabled\n options\n }\n aiPowerups {\n enabled\n options\n }\n }\n }\n }\n error {\n message\n code\n data\n }\n }\n }\n }\n`;\n\nclass WcpGraphQLGateway implements WcpGatewayAbstraction.Interface {\n constructor(private client: MainGraphQLClient.Interface) {}\n\n async fetchProject(): Promise<WcpProjectData | null> {\n const response = await this.client.execute<GetWcpProjectResponse>({\n query: GET_WCP_PROJECT,\n headers: {\n \"x-tenant\": \"root\"\n }\n });\n\n if (response.wcp.getProject.error) {\n throw new Error(response.wcp.getProject.error.message);\n }\n\n return response.wcp.getProject.data;\n }\n}\n\nexport const WcpGateway = createImplementation({\n abstraction: WcpGatewayAbstraction,\n implementation: WcpGraphQLGateway,\n dependencies: [MainGraphQLClient]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,UAAU,IAAIC,qBAAqB;AAC5C,SAASC,iBAAiB,QAAQ,iDAAiD;AAGnF,MAAMC,eAAe,GAAG,aAAc;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,MAAMC,iBAAiB,CAA4C;EAC/DC,WAAWA,CAASC,MAAmC,EAAE;IAAA,KAArCA,MAAmC,GAAnCA,MAAmC;EAAG;EAE1D,MAAMC,YAAYA,CAAA,EAAmC;IACjD,MAAMC,QAAQ,GAAG,MAAM,IAAI,CAACF,MAAM,CAACG,OAAO,CAAwB;MAC9DC,KAAK,EAAEP,eAAe;MACtBQ,OAAO,EAAE;QACL,UAAU,EAAE;MAChB;IACJ,CAAC,CAAC;IAEF,IAAIH,QAAQ,CAACI,GAAG,CAACC,UAAU,CAACC,KAAK,EAAE;MAC/B,MAAM,IAAIC,KAAK,CAACP,QAAQ,CAACI,GAAG,CAACC,UAAU,CAACC,KAAK,CAACE,OAAO,CAAC;IAC1D;IAEA,OAAOR,QAAQ,CAACI,GAAG,CAACC,UAAU,CAACI,IAAI;EACvC;AACJ;AAEA,OAAO,MAAMjB,UAAU,GAAGD,oBAAoB,CAAC;EAC3CmB,WAAW,EAAEjB,qBAAqB;EAClCkB,cAAc,EAAEf,iBAAiB;EACjCgB,YAAY,EAAE,CAAClB,iBAAiB;AACpC,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ import { Webiny } from "@webiny/sdk";
2
+ import { AuthenticationContext } from "../../features/security/AuthenticationContext/index.js";
3
+ import { EnvConfig } from "@webiny/app/features/envConfig";
4
+ import { TenantContext } from "../../features/tenancy/abstractions.js";
5
+ declare class WebinySdkImpl extends Webiny {
6
+ constructor(authContext: AuthenticationContext.Interface, envConfig: EnvConfig.Interface, tenantContext: TenantContext.Interface);
7
+ }
8
+ export declare const WebinySdk: typeof WebinySdkImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<Webiny>;
10
+ };
11
+ export {};
@@ -0,0 +1,27 @@
1
+ import { Webiny } from "@webiny/sdk";
2
+ import { WebinySdk as Abstraction } from "./abstractions.js";
3
+ import { AuthenticationContext } from "../security/AuthenticationContext/index.js";
4
+ import { EnvConfig } from "@webiny/app/features/envConfig";
5
+ import { TenantContext } from "../tenancy/abstractions.js";
6
+
7
+ // Authenticated SDK singleton that configures the Webiny SDK with
8
+ // the API endpoint, current tenant, and a token provider that
9
+ // delegates to AuthenticationContext.getIdToken().
10
+ class WebinySdkImpl extends Webiny {
11
+ constructor(authContext, envConfig, tenantContext) {
12
+ super({
13
+ endpoint: envConfig.get("apiUrl"),
14
+ tenant: tenantContext.getCurrentTenant() || "root",
15
+ token: async () => {
16
+ const token = await authContext.getIdToken();
17
+ return token ?? "";
18
+ }
19
+ });
20
+ }
21
+ }
22
+ export const WebinySdk = Abstraction.createImplementation({
23
+ implementation: WebinySdkImpl,
24
+ dependencies: [AuthenticationContext, EnvConfig, TenantContext]
25
+ });
26
+
27
+ //# sourceMappingURL=WebinySdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Webiny","WebinySdk","Abstraction","AuthenticationContext","EnvConfig","TenantContext","WebinySdkImpl","constructor","authContext","envConfig","tenantContext","endpoint","get","tenant","getCurrentTenant","token","getIdToken","createImplementation","implementation","dependencies"],"sources":["WebinySdk.ts"],"sourcesContent":["import { Webiny } from \"@webiny/sdk\";\nimport { WebinySdk as Abstraction } from \"./abstractions.js\";\nimport { AuthenticationContext } from \"~/features/security/AuthenticationContext/index.js\";\nimport { EnvConfig } from \"@webiny/app/features/envConfig\";\nimport { TenantContext } from \"~/features/tenancy/abstractions.js\";\n\n// Authenticated SDK singleton that configures the Webiny SDK with\n// the API endpoint, current tenant, and a token provider that\n// delegates to AuthenticationContext.getIdToken().\nclass WebinySdkImpl extends Webiny {\n constructor(\n authContext: AuthenticationContext.Interface,\n envConfig: EnvConfig.Interface,\n tenantContext: TenantContext.Interface\n ) {\n super({\n endpoint: envConfig.get(\"apiUrl\"),\n tenant: tenantContext.getCurrentTenant() || \"root\",\n token: async () => {\n const token = await authContext.getIdToken();\n return token ?? \"\";\n }\n });\n }\n}\n\nexport const WebinySdk = Abstraction.createImplementation({\n implementation: WebinySdkImpl,\n dependencies: [AuthenticationContext, EnvConfig, TenantContext]\n});\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,aAAa;AACpC,SAASC,SAAS,IAAIC,WAAW;AACjC,SAASC,qBAAqB;AAC9B,SAASC,SAAS,QAAQ,gCAAgC;AAC1D,SAASC,aAAa;;AAEtB;AACA;AACA;AACA,MAAMC,aAAa,SAASN,MAAM,CAAC;EAC/BO,WAAWA,CACPC,WAA4C,EAC5CC,SAA8B,EAC9BC,aAAsC,EACxC;IACE,KAAK,CAAC;MACFC,QAAQ,EAAEF,SAAS,CAACG,GAAG,CAAC,QAAQ,CAAC;MACjCC,MAAM,EAAEH,aAAa,CAACI,gBAAgB,CAAC,CAAC,IAAI,MAAM;MAClDC,KAAK,EAAE,MAAAA,CAAA,KAAY;QACf,MAAMA,KAAK,GAAG,MAAMP,WAAW,CAACQ,UAAU,CAAC,CAAC;QAC5C,OAAOD,KAAK,IAAI,EAAE;MACtB;IACJ,CAAC,CAAC;EACN;AACJ;AAEA,OAAO,MAAMd,SAAS,GAAGC,WAAW,CAACe,oBAAoB,CAAC;EACtDC,cAAc,EAAEZ,aAAa;EAC7Ba,YAAY,EAAE,CAAChB,qBAAqB,EAAEC,SAAS,EAAEC,aAAa;AAClE,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ import type { Webiny } from "@webiny/sdk";
2
+ export type IWebinySdk = Webiny;
3
+ export declare const WebinySdk: import("@webiny/di").Abstraction<Webiny>;
4
+ export declare namespace WebinySdk {
5
+ type Interface = IWebinySdk;
6
+ }
@@ -0,0 +1,8 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+
3
+ // The WebinySdk abstraction wraps the Webiny SDK instance.
4
+ // Gateways inject this to call sdk.fileManager.*, sdk.cms.*, etc.
5
+
6
+ export const WebinySdk = createAbstraction("WebinySdk");
7
+
8
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createAbstraction","WebinySdk"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { Webiny } from \"@webiny/sdk\";\n\n// The WebinySdk abstraction wraps the Webiny SDK instance.\n// Gateways inject this to call sdk.fileManager.*, sdk.cms.*, etc.\nexport type IWebinySdk = Webiny;\n\nexport const WebinySdk = createAbstraction<IWebinySdk>(\"WebinySdk\");\n\nexport namespace WebinySdk {\n export type Interface = IWebinySdk;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,uBAAuB;;AAGzD;AACA;;AAGA,OAAO,MAAMC,SAAS,GAAGD,iBAAiB,CAAa,WAAW,CAAC","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ export declare const WebinySdkFeature: import("@webiny/feature/admin").FeatureDefinition<{
2
+ sdk: import("@webiny/sdk/Webiny.js").Webiny;
3
+ }, []>;
@@ -0,0 +1,16 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { WebinySdk as Abstraction } from "./abstractions.js";
3
+ import { WebinySdk } from "./WebinySdk.js";
4
+ export const WebinySdkFeature = createFeature({
5
+ name: "WebinySdk",
6
+ register(container) {
7
+ container.register(WebinySdk).inSingletonScope();
8
+ },
9
+ resolve(container) {
10
+ return {
11
+ sdk: container.resolve(Abstraction)
12
+ };
13
+ }
14
+ });
15
+
16
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createFeature","WebinySdk","Abstraction","WebinySdkFeature","name","register","container","inSingletonScope","resolve","sdk"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport type { Container } from \"@webiny/di\";\nimport { WebinySdk as Abstraction } from \"./abstractions.js\";\nimport { WebinySdk } from \"./WebinySdk.js\";\n\nexport const WebinySdkFeature = createFeature({\n name: \"WebinySdk\",\n register(container: Container) {\n container.register(WebinySdk).inSingletonScope();\n },\n resolve(container: Container) {\n return {\n sdk: container.resolve(Abstraction)\n };\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,uBAAuB;AAErD,SAASC,SAAS,IAAIC,WAAW;AACjC,SAASD,SAAS;AAElB,OAAO,MAAME,gBAAgB,GAAGH,aAAa,CAAC;EAC1CI,IAAI,EAAE,WAAW;EACjBC,QAAQA,CAACC,SAAoB,EAAE;IAC3BA,SAAS,CAACD,QAAQ,CAACJ,SAAS,CAAC,CAACM,gBAAgB,CAAC,CAAC;EACpD,CAAC;EACDC,OAAOA,CAACF,SAAoB,EAAE;IAC1B,OAAO;MACHG,GAAG,EAAEH,SAAS,CAACE,OAAO,CAACN,WAAW;IACtC,CAAC;EACL;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export { WebinySdk } from "./abstractions.js";
2
+ export { WebinySdkFeature } from "./feature.js";
@@ -0,0 +1,4 @@
1
+ export { WebinySdk } from "./abstractions.js";
2
+ export { WebinySdkFeature } from "./feature.js";
3
+
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["WebinySdk","WebinySdkFeature"],"sources":["index.ts"],"sourcesContent":["export { WebinySdk } from \"./abstractions.js\";\nexport { WebinySdkFeature } from \"./feature.js\";\n"],"mappings":"AAAA,SAASA,SAAS;AAClB,SAASC,gBAAgB","ignoreList":[]}
package/index.d.ts CHANGED
@@ -27,6 +27,9 @@ export { SystemInstallerProvider } from "./presentation/installation/components/
27
27
  export type { AaclPermission } from "./features/wcp/types.js";
28
28
  export type { Tenant } from "./features/tenancy/types.js";
29
29
  export { BuildParamsFeature } from "./features/buildParams/feature.js";
30
+ export { ToolsFeature } from "./features/tools/feature.js";
31
+ export { Tool, ToolRegistry, ToolPipelineRunner } from "./features/tools/abstractions.js";
32
+ export type { ITool, IToolRegistry, IToolPipelineRunner } from "./features/tools/abstractions.js";
30
33
  export * from "./hooks/index.js";
31
34
  export { useWcp } from "./presentation/wcp/useWcp.js";
32
35
  export { useTenantContext } from "./presentation/tenancy/useTenantContext.js";
@@ -35,8 +38,10 @@ export { useAuthentication } from "./presentation/security/hooks/useAuthenticati
35
38
  export { useBuildParams } from "./presentation/buildParams/useBuildParams.js";
36
39
  export { useSecurity } from "./presentation/security/hooks/useSecurity.js";
37
40
  export * from "@webiny/app/renderApp.js";
41
+ import "./features/formModel/renderers.js";
38
42
  export { FormModelFactory, FormModel } from "./features/formModel/abstractions.js";
39
- export type { IFormModelFactory, IFormModelConfig, ILayoutBuilder, IFieldBuilder, ISelectFieldBuilder, IFieldBuilderRegistry, IFormModel, IField, ISelectField, FieldTypeMap, IFieldConfig, IFieldVM, IFieldValidation, IFormVM, IFormError, IValueOption, IRowNode, IRowNodeVM, LayoutNode, LayoutNodeVM, LayoutPosition, IPositionedLayoutNode, ILayoutNodeHandle, ILayoutModifier, IFormModifier, BeforeChangeCallback, AfterChangeCallback, AfterSetValueCallback } from "./features/formModel/abstractions.js";
40
- export { FormView } from "./features/formModel/FormView.js";
43
+ export type { IFieldRendererRegistry, FieldRendererName, FieldRendererSettings, IFormModelFactory, IFormModelConfig, ILayoutBuilder, IFieldBuilder, ISelectFieldBuilder, IFieldBuilderRegistry, IFormModel, IField, ISelectField, FieldTypeMap, IFieldConfig, IFieldVM, IFieldValidation, IFormVM, IFormError, IValueOption, IRowNode, IRowNodeVM, LayoutNode, LayoutNodeVM, LayoutPosition, IPositionedLayoutNode, ILayoutNodeHandle, ILayoutModifier, IFormModifier, BeforeChangeCallback, AfterChangeCallback, AfterSetValueCallback } from "./features/formModel/abstractions.js";
44
+ export { FormView, LayoutNodeRenderer, useFormViewRenderers } from "./features/formModel/FormView.js";
41
45
  export { useFieldRenderers } from "./features/formModel/useFieldRenderers.js";
42
- export type { FieldRenderers, FieldRendererComponent } from "./features/formModel/FormView.js";
46
+ export { useLayoutRenderers } from "./features/formModel/useLayoutRenderers.js";
47
+ export type { FieldRenderers, FieldRendererComponent, LayoutRenderers, TabsNodeRendererProps } from "./features/formModel/FormView.js";
package/index.js CHANGED
@@ -31,7 +31,8 @@ export { SystemInstallerProvider } from "./presentation/installation/components/
31
31
  // Feature types
32
32
 
33
33
  export { BuildParamsFeature } from "./features/buildParams/feature.js";
34
-
34
+ export { ToolsFeature } from "./features/tools/feature.js";
35
+ export { Tool, ToolRegistry, ToolPipelineRunner } from "./features/tools/abstractions.js";
35
36
  // Hooks
36
37
  export * from "./hooks/index.js";
37
38
  export { useWcp } from "./presentation/wcp/useWcp.js";
@@ -45,8 +46,10 @@ export { useSecurity } from "./presentation/security/hooks/useSecurity.js";
45
46
  export * from "@webiny/app/renderApp.js";
46
47
 
47
48
  // FormModel
49
+ import "./features/formModel/renderers.js";
48
50
  export { FormModelFactory, FormModel } from "./features/formModel/abstractions.js";
49
- export { FormView } from "./features/formModel/FormView.js";
51
+ export { FormView, LayoutNodeRenderer, useFormViewRenderers } from "./features/formModel/FormView.js";
50
52
  export { useFieldRenderers } from "./features/formModel/useFieldRenderers.js";
53
+ export { useLayoutRenderers } from "./features/formModel/useLayoutRenderers.js";
51
54
 
52
55
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["Admin","HasPermission","SecureRoute","FileManager","FileManagerRenderer","SystemInstallerProvider","BuildParamsFeature","useWcp","useTenantContext","useIdentity","useAuthentication","useBuildParams","useSecurity","FormModelFactory","FormModel","FormView","useFieldRenderers"],"sources":["index.ts"],"sourcesContent":["export * from \"@webiny/app\";\nexport type { HigherOrderComponent, ProviderProps, ComposeProps } from \"@webiny/app\";\n// UI components\nexport * from \"./base/ui/Tags.js\";\nexport * from \"./base/ui/Layout.js\";\nexport * from \"./base/ui/TenantSelector.js\";\nexport type { LayoutProps } from \"./base/ui/Layout.js\";\nexport * from \"./base/ui/Navigation.js\";\nexport * from \"./base/ui/Brand.js\";\nexport * from \"./base/ui/Logo.js\";\nexport * from \"./base/ui/UserMenu.js\";\nexport * from \"./base/ui/LoginScreen.js\";\nexport * from \"./base/ui/CenteredView.js\";\nexport * from \"./base/ui/Dashboard.js\";\nexport * from \"./base/ui/NotFound.js\";\n\n// Base admin app\nexport { Admin } from \"./base/Admin.js\";\nexport * from \"./config/AdminConfig.js\";\n\nexport type { AdminProps } from \"./base/Admin.js\";\n\n// Plugins\nexport * from \"./base/plugins/AddGraphQLQuerySelection.js\";\n\n// Permissions\nexport * from \"./permissions/index.js\";\n\n// Components\nexport * from \"./components/index.js\";\nexport type { RichTextValueWithHtml } from \"./components/index.js\";\nexport { HasPermission } from \"./presentation/security/components/HasPermission.js\";\nexport { SecureRoute } from \"./presentation/security/components/SecureRoute.js\";\n\nexport { FileManager, FileManagerRenderer } from \"./base/ui/FileManager.js\";\nexport type {\n FileManagerProps,\n FileManagerRendererProps,\n FileManagerFileItem,\n FileManagerOnChange\n} from \"./base/ui/FileManager.js\";\n\nexport { SystemInstallerProvider } from \"./presentation/installation/components/SystemInstaller/index.js\";\n\n// Feature types\nexport type { AaclPermission } from \"./features/wcp/types.js\";\nexport type { Tenant } from \"./features/tenancy/types.js\";\n\nexport { BuildParamsFeature } from \"./features/buildParams/feature.js\";\n\n// Hooks\nexport * from \"./hooks/index.js\";\nexport { useWcp } from \"./presentation/wcp/useWcp.js\";\nexport { useTenantContext } from \"./presentation/tenancy/useTenantContext.js\";\nexport { useIdentity } from \"./presentation/security/hooks/useIdentity.js\";\nexport { useAuthentication } from \"./presentation/security/hooks/useAuthentication.js\";\nexport { useBuildParams } from \"./presentation/buildParams/useBuildParams.js\";\n\n// Legacy hook for easier migration\nexport { useSecurity } from \"./presentation/security/hooks/useSecurity.js\";\n\nexport * from \"@webiny/app/renderApp.js\";\n\n// FormModel\nexport { FormModelFactory, FormModel } from \"./features/formModel/abstractions.js\";\nexport type {\n IFormModelFactory,\n IFormModelConfig,\n ILayoutBuilder,\n IFieldBuilder,\n ISelectFieldBuilder,\n IFieldBuilderRegistry,\n IFormModel,\n IField,\n ISelectField,\n FieldTypeMap,\n IFieldConfig,\n IFieldVM,\n IFieldValidation,\n IFormVM,\n IFormError,\n IValueOption,\n IRowNode,\n IRowNodeVM,\n LayoutNode,\n LayoutNodeVM,\n LayoutPosition,\n IPositionedLayoutNode,\n ILayoutNodeHandle,\n ILayoutModifier,\n IFormModifier,\n BeforeChangeCallback,\n AfterChangeCallback,\n AfterSetValueCallback\n} from \"./features/formModel/abstractions.js\";\nexport { FormView } from \"./features/formModel/FormView.js\";\nexport { useFieldRenderers } from \"./features/formModel/useFieldRenderers.js\";\nexport type { FieldRenderers, FieldRendererComponent } from \"./features/formModel/FormView.js\";\n"],"mappings":"AAAA,cAAc,aAAa;AAE3B;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAASA,KAAK;AACd;AAIA;AACA;;AAEA;AACA;;AAEA;AACA;AAEA,SAASC,aAAa;AACtB,SAASC,WAAW;AAEpB,SAASC,WAAW,EAAEC,mBAAmB;AAQzC,SAASC,uBAAuB;;AAEhC;;AAIA,SAASC,kBAAkB;;AAE3B;AACA;AACA,SAASC,MAAM;AACf,SAASC,gBAAgB;AACzB,SAASC,WAAW;AACpB,SAASC,iBAAiB;AAC1B,SAASC,cAAc;;AAEvB;AACA,SAASC,WAAW;AAEpB,cAAc,0BAA0B;;AAExC;AACA,SAASC,gBAAgB,EAAEC,SAAS;AA+BpC,SAASC,QAAQ;AACjB,SAASC,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["Admin","HasPermission","SecureRoute","FileManager","FileManagerRenderer","SystemInstallerProvider","BuildParamsFeature","ToolsFeature","Tool","ToolRegistry","ToolPipelineRunner","useWcp","useTenantContext","useIdentity","useAuthentication","useBuildParams","useSecurity","FormModelFactory","FormModel","FormView","LayoutNodeRenderer","useFormViewRenderers","useFieldRenderers","useLayoutRenderers"],"sources":["index.ts"],"sourcesContent":["export * from \"@webiny/app\";\nexport type { HigherOrderComponent, ProviderProps, ComposeProps } from \"@webiny/app\";\n// UI components\nexport * from \"./base/ui/Tags.js\";\nexport * from \"./base/ui/Layout.js\";\nexport * from \"./base/ui/TenantSelector.js\";\nexport type { LayoutProps } from \"./base/ui/Layout.js\";\nexport * from \"./base/ui/Navigation.js\";\nexport * from \"./base/ui/Brand.js\";\nexport * from \"./base/ui/Logo.js\";\nexport * from \"./base/ui/UserMenu.js\";\nexport * from \"./base/ui/LoginScreen.js\";\nexport * from \"./base/ui/CenteredView.js\";\nexport * from \"./base/ui/Dashboard.js\";\nexport * from \"./base/ui/NotFound.js\";\n\n// Base admin app\nexport { Admin } from \"./base/Admin.js\";\nexport * from \"./config/AdminConfig.js\";\n\nexport type { AdminProps } from \"./base/Admin.js\";\n\n// Plugins\nexport * from \"./base/plugins/AddGraphQLQuerySelection.js\";\n\n// Permissions\nexport * from \"./permissions/index.js\";\n\n// Components\nexport * from \"./components/index.js\";\nexport type { RichTextValueWithHtml } from \"./components/index.js\";\nexport { HasPermission } from \"./presentation/security/components/HasPermission.js\";\nexport { SecureRoute } from \"./presentation/security/components/SecureRoute.js\";\n\nexport { FileManager, FileManagerRenderer } from \"./base/ui/FileManager.js\";\nexport type {\n FileManagerProps,\n FileManagerRendererProps,\n FileManagerFileItem,\n FileManagerOnChange\n} from \"./base/ui/FileManager.js\";\n\nexport { SystemInstallerProvider } from \"./presentation/installation/components/SystemInstaller/index.js\";\n\n// Feature types\nexport type { AaclPermission } from \"./features/wcp/types.js\";\nexport type { Tenant } from \"./features/tenancy/types.js\";\n\nexport { BuildParamsFeature } from \"./features/buildParams/feature.js\";\nexport { ToolsFeature } from \"./features/tools/feature.js\";\nexport { Tool, ToolRegistry, ToolPipelineRunner } from \"./features/tools/abstractions.js\";\nexport type { ITool, IToolRegistry, IToolPipelineRunner } from \"./features/tools/abstractions.js\";\n\n// Hooks\nexport * from \"./hooks/index.js\";\nexport { useWcp } from \"./presentation/wcp/useWcp.js\";\nexport { useTenantContext } from \"./presentation/tenancy/useTenantContext.js\";\nexport { useIdentity } from \"./presentation/security/hooks/useIdentity.js\";\nexport { useAuthentication } from \"./presentation/security/hooks/useAuthentication.js\";\nexport { useBuildParams } from \"./presentation/buildParams/useBuildParams.js\";\n\n// Legacy hook for easier migration\nexport { useSecurity } from \"./presentation/security/hooks/useSecurity.js\";\n\nexport * from \"@webiny/app/renderApp.js\";\n\n// FormModel\nimport \"./features/formModel/renderers.js\";\nexport { FormModelFactory, FormModel } from \"./features/formModel/abstractions.js\";\nexport type {\n IFieldRendererRegistry,\n FieldRendererName,\n FieldRendererSettings,\n IFormModelFactory,\n IFormModelConfig,\n ILayoutBuilder,\n IFieldBuilder,\n ISelectFieldBuilder,\n IFieldBuilderRegistry,\n IFormModel,\n IField,\n ISelectField,\n FieldTypeMap,\n IFieldConfig,\n IFieldVM,\n IFieldValidation,\n IFormVM,\n IFormError,\n IValueOption,\n IRowNode,\n IRowNodeVM,\n LayoutNode,\n LayoutNodeVM,\n LayoutPosition,\n IPositionedLayoutNode,\n ILayoutNodeHandle,\n ILayoutModifier,\n IFormModifier,\n BeforeChangeCallback,\n AfterChangeCallback,\n AfterSetValueCallback\n} from \"./features/formModel/abstractions.js\";\nexport {\n FormView,\n LayoutNodeRenderer,\n useFormViewRenderers\n} from \"./features/formModel/FormView.js\";\nexport { useFieldRenderers } from \"./features/formModel/useFieldRenderers.js\";\nexport { useLayoutRenderers } from \"./features/formModel/useLayoutRenderers.js\";\nexport type {\n FieldRenderers,\n FieldRendererComponent,\n LayoutRenderers,\n TabsNodeRendererProps\n} from \"./features/formModel/FormView.js\";\n"],"mappings":"AAAA,cAAc,aAAa;AAE3B;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAASA,KAAK;AACd;AAIA;AACA;;AAEA;AACA;;AAEA;AACA;AAEA,SAASC,aAAa;AACtB,SAASC,WAAW;AAEpB,SAASC,WAAW,EAAEC,mBAAmB;AAQzC,SAASC,uBAAuB;;AAEhC;;AAIA,SAASC,kBAAkB;AAC3B,SAASC,YAAY;AACrB,SAASC,IAAI,EAAEC,YAAY,EAAEC,kBAAkB;AAG/C;AACA;AACA,SAASC,MAAM;AACf,SAASC,gBAAgB;AACzB,SAASC,WAAW;AACpB,SAASC,iBAAiB;AAC1B,SAASC,cAAc;;AAEvB;AACA,SAASC,WAAW;AAEpB,cAAc,0BAA0B;;AAExC;AACA;AACA,SAASC,gBAAgB,EAAEC,SAAS;AAkCpC,SACIC,QAAQ,EACRC,kBAAkB,EAClBC,oBAAoB;AAExB,SAASC,iBAAiB;AAC1B,SAASC,kBAAkB","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-admin",
3
- "version": "6.2.0",
3
+ "version": "6.3.0-beta.1",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "description": "A collection of plugins that together form a complete admin interface, customizable and extensible with Webiny apps and plugins.",
@@ -16,26 +16,27 @@
16
16
  "@emotion/css": "11.13.5",
17
17
  "@emotion/react": "11.14.0",
18
18
  "@emotion/styled": "11.14.1",
19
- "@iconify/json": "2.2.462",
19
+ "@iconify/json": "2.2.463",
20
20
  "@svgr/webpack": "8.1.0",
21
21
  "@types/react": "18.3.28",
22
- "@webiny/admin-ui": "6.2.0",
23
- "@webiny/app": "6.2.0",
22
+ "@webiny/admin-ui": "6.3.0-beta.1",
23
+ "@webiny/app": "6.3.0-beta.1",
24
24
  "@webiny/di": "0.2.3",
25
- "@webiny/feature": "6.2.0",
26
- "@webiny/form": "6.2.0",
27
- "@webiny/icons": "6.2.0",
28
- "@webiny/lexical-converter": "6.2.0",
29
- "@webiny/lexical-editor": "6.2.0",
30
- "@webiny/lexical-theme": "6.2.0",
31
- "@webiny/plugins": "6.2.0",
32
- "@webiny/react-composition": "6.2.0",
33
- "@webiny/react-properties": "6.2.0",
34
- "@webiny/telemetry": "6.2.0",
35
- "@webiny/ui": "6.2.0",
36
- "@webiny/utils": "6.2.0",
37
- "@webiny/validation": "6.2.0",
38
- "@webiny/wcp": "6.2.0",
25
+ "@webiny/feature": "6.3.0-beta.1",
26
+ "@webiny/form": "6.3.0-beta.1",
27
+ "@webiny/icons": "6.3.0-beta.1",
28
+ "@webiny/lexical-converter": "6.3.0-beta.1",
29
+ "@webiny/lexical-editor": "6.3.0-beta.1",
30
+ "@webiny/lexical-theme": "6.3.0-beta.1",
31
+ "@webiny/plugins": "6.3.0-beta.1",
32
+ "@webiny/react-composition": "6.3.0-beta.1",
33
+ "@webiny/react-properties": "6.3.0-beta.1",
34
+ "@webiny/sdk": "6.3.0-beta.1",
35
+ "@webiny/telemetry": "6.3.0-beta.1",
36
+ "@webiny/ui": "6.3.0-beta.1",
37
+ "@webiny/utils": "6.3.0-beta.1",
38
+ "@webiny/validation": "6.3.0-beta.1",
39
+ "@webiny/wcp": "6.3.0-beta.1",
39
40
  "apollo-cache": "1.3.5",
40
41
  "apollo-client": "2.6.10",
41
42
  "apollo-link": "1.2.14",
@@ -47,7 +48,7 @@
47
48
  "history": "5.3.0",
48
49
  "is-hotkey": "0.2.0",
49
50
  "lodash": "4.18.1",
50
- "markdown-to-jsx": "9.7.15",
51
+ "markdown-to-jsx": "9.7.16",
51
52
  "minimatch": "10.2.5",
52
53
  "mobx": "6.15.0",
53
54
  "mobx-react-lite": "4.1.1",
@@ -59,7 +60,7 @@
59
60
  "react-virtualized": "9.22.6",
60
61
  "reset-css": "5.0.2",
61
62
  "tinycolor2": "1.6.0",
62
- "unicode-emoji-json": "0.8.0",
63
+ "unicode-emoji-json": "0.9.0",
63
64
  "zod": "4.3.6"
64
65
  },
65
66
  "devDependencies": {
@@ -72,9 +73,9 @@
72
73
  "@types/react-transition-group": "4.4.12",
73
74
  "@types/store": "2.0.5",
74
75
  "@types/tinycolor2": "1.4.6",
75
- "@webiny/build-tools": "6.2.0",
76
+ "@webiny/build-tools": "6.3.0-beta.1",
76
77
  "rimraf": "6.1.3",
77
- "typescript": "5.9.3",
78
+ "typescript": "6.0.3",
78
79
  "vitest": "4.1.4"
79
80
  },
80
81
  "publishConfig": {
@@ -98,5 +99,5 @@
98
99
  ]
99
100
  }
100
101
  },
101
- "gitHead": "3d3148358b6febbc857371930871743bec3b3939"
102
+ "gitHead": "664b273a9f0a971f9ca7e6ffe920db77fefdced1"
102
103
  }
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ import { Tool } from "../../exports/admin.js";
3
+ declare const inputSchema: z.ZodObject<{
4
+ text: z.ZodString;
5
+ }, z.core.$strip>;
6
+ declare const outputSchema: z.ZodObject<{
7
+ state: z.ZodString;
8
+ html: z.ZodString;
9
+ }, z.core.$strip>;
10
+ type Input = z.infer<typeof inputSchema>;
11
+ type Output = z.infer<typeof outputSchema>;
12
+ declare class TextToLexicalToolImpl implements Tool.Interface<typeof inputSchema, typeof outputSchema> {
13
+ readonly name = "textToLexical";
14
+ readonly description = "Converts a plain text string into Lexical editor state. Use for all 'lexical' type inputs.";
15
+ readonly inputSchema: z.ZodObject<{
16
+ text: z.ZodString;
17
+ }, z.core.$strip>;
18
+ readonly outputSchema: z.ZodObject<{
19
+ state: z.ZodString;
20
+ html: z.ZodString;
21
+ }, z.core.$strip>;
22
+ execute(input: Input): Promise<Output>;
23
+ }
24
+ export declare const TextToLexicalTool: typeof TextToLexicalToolImpl & {
25
+ __abstraction: import("@webiny/di").Abstraction<import("../../index.js").ITool<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
26
+ };
27
+ export {};
@@ -0,0 +1,25 @@
1
+ import { z } from "zod";
2
+ import { Tool } from "../../exports/admin.js";
3
+ import { textToLexicalState } from "./textToLexicalState.js";
4
+ const inputSchema = z.object({
5
+ text: z.string().describe("Text content")
6
+ });
7
+ const outputSchema = z.object({
8
+ state: z.string().describe("Lexical editor state as JSON string"),
9
+ html: z.string().describe("HTML representation of the content")
10
+ }).describe("Lexical editor state with HTML");
11
+ class TextToLexicalToolImpl {
12
+ name = "textToLexical";
13
+ description = "Converts a plain text string into Lexical editor state. Use for all 'lexical' type inputs.";
14
+ inputSchema = inputSchema;
15
+ outputSchema = outputSchema;
16
+ async execute(input) {
17
+ return textToLexicalState(input.text);
18
+ }
19
+ }
20
+ export const TextToLexicalTool = Tool.createImplementation({
21
+ implementation: TextToLexicalToolImpl,
22
+ dependencies: []
23
+ });
24
+
25
+ //# sourceMappingURL=TextToLexicalTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["z","Tool","textToLexicalState","inputSchema","object","text","string","describe","outputSchema","state","html","TextToLexicalToolImpl","name","description","execute","input","TextToLexicalTool","createImplementation","implementation","dependencies"],"sources":["TextToLexicalTool.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { Tool } from \"~/exports/admin.js\";\nimport { textToLexicalState } from \"./textToLexicalState.js\";\n\nconst inputSchema = z.object({\n text: z.string().describe(\"Text content\")\n});\n\nconst outputSchema = z\n .object({\n state: z.string().describe(\"Lexical editor state as JSON string\"),\n html: z.string().describe(\"HTML representation of the content\")\n })\n .describe(\"Lexical editor state with HTML\");\n\ntype Input = z.infer<typeof inputSchema>;\ntype Output = z.infer<typeof outputSchema>;\n\nclass TextToLexicalToolImpl implements Tool.Interface<typeof inputSchema, typeof outputSchema> {\n readonly name = \"textToLexical\";\n readonly description =\n \"Converts a plain text string into Lexical editor state. Use for all 'lexical' type inputs.\";\n readonly inputSchema = inputSchema;\n readonly outputSchema = outputSchema;\n\n async execute(input: Input): Promise<Output> {\n return textToLexicalState(input.text);\n }\n}\n\nexport const TextToLexicalTool = Tool.createImplementation({\n implementation: TextToLexicalToolImpl,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AACvB,SAASC,IAAI;AACb,SAASC,kBAAkB;AAE3B,MAAMC,WAAW,GAAGH,CAAC,CAACI,MAAM,CAAC;EACzBC,IAAI,EAAEL,CAAC,CAACM,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,cAAc;AAC5C,CAAC,CAAC;AAEF,MAAMC,YAAY,GAAGR,CAAC,CACjBI,MAAM,CAAC;EACJK,KAAK,EAAET,CAAC,CAACM,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,qCAAqC,CAAC;EACjEG,IAAI,EAAEV,CAAC,CAACM,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,oCAAoC;AAClE,CAAC,CAAC,CACDA,QAAQ,CAAC,gCAAgC,CAAC;AAK/C,MAAMI,qBAAqB,CAAoE;EAClFC,IAAI,GAAG,eAAe;EACtBC,WAAW,GAChB,4FAA4F;EACvFV,WAAW,GAAGA,WAAW;EACzBK,YAAY,GAAGA,YAAY;EAEpC,MAAMM,OAAOA,CAACC,KAAY,EAAmB;IACzC,OAAOb,kBAAkB,CAACa,KAAK,CAACV,IAAI,CAAC;EACzC;AACJ;AAEA,OAAO,MAAMW,iBAAiB,GAAGf,IAAI,CAACgB,oBAAoB,CAAC;EACvDC,cAAc,EAAEP,qBAAqB;EACrCQ,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export declare const TextToLexicalToolFeature: import("@webiny/feature/admin").FeatureDefinition<any, []>;
@@ -0,0 +1,10 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { TextToLexicalTool } from "./TextToLexicalTool.js";
3
+ export const TextToLexicalToolFeature = createFeature({
4
+ name: "Tools/TextToLexicalTool",
5
+ register(container) {
6
+ container.register(TextToLexicalTool);
7
+ }
8
+ });
9
+
10
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createFeature","TextToLexicalTool","TextToLexicalToolFeature","name","register","container"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { TextToLexicalTool } from \"./TextToLexicalTool.js\";\n\nexport const TextToLexicalToolFeature = createFeature({\n name: \"Tools/TextToLexicalTool\",\n register(container) {\n container.register(TextToLexicalTool);\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,uBAAuB;AACrD,SAASC,iBAAiB;AAE1B,OAAO,MAAMC,wBAAwB,GAAGF,aAAa,CAAC;EAClDG,IAAI,EAAE,yBAAyB;EAC/BC,QAAQA,CAACC,SAAS,EAAE;IAChBA,SAAS,CAACD,QAAQ,CAACH,iBAAiB,CAAC;EACzC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ export interface LexicalValue {
2
+ state: string;
3
+ html: string;
4
+ }
5
+ export declare function textToLexicalState(text: string): LexicalValue;
@@ -0,0 +1,19 @@
1
+ import { createHtmlToLexicalParser } from "@webiny/lexical-converter";
2
+ import { createLexicalStateTransformer } from "@webiny/lexical-converter";
3
+ export function textToLexicalState(text) {
4
+ const parser = createHtmlToLexicalParser();
5
+ const domParser = new DOMParser();
6
+ const state = parser(domParser.parseFromString(text, "text/html"));
7
+ if (!state) {
8
+ throw new Error("Failed to parse text into Lexical state.");
9
+ }
10
+ const stateJson = JSON.stringify(state);
11
+ const transformer = createLexicalStateTransformer();
12
+ const html = transformer.toHtml(stateJson);
13
+ return {
14
+ state: stateJson,
15
+ html
16
+ };
17
+ }
18
+
19
+ //# sourceMappingURL=textToLexicalState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createHtmlToLexicalParser","createLexicalStateTransformer","textToLexicalState","text","parser","domParser","DOMParser","state","parseFromString","Error","stateJson","JSON","stringify","transformer","html","toHtml"],"sources":["textToLexicalState.ts"],"sourcesContent":["import { createHtmlToLexicalParser } from \"@webiny/lexical-converter\";\nimport { createLexicalStateTransformer } from \"@webiny/lexical-converter\";\n\nexport interface LexicalValue {\n state: string;\n html: string;\n}\n\nexport function textToLexicalState(text: string): LexicalValue {\n const parser = createHtmlToLexicalParser();\n const domParser = new DOMParser();\n const state = parser(domParser.parseFromString(text, \"text/html\"));\n\n if (!state) {\n throw new Error(\"Failed to parse text into Lexical state.\");\n }\n\n const stateJson = JSON.stringify(state);\n\n const transformer = createLexicalStateTransformer();\n const html = transformer.toHtml(stateJson);\n\n return { state: stateJson, html };\n}\n"],"mappings":"AAAA,SAASA,yBAAyB,QAAQ,2BAA2B;AACrE,SAASC,6BAA6B,QAAQ,2BAA2B;AAOzE,OAAO,SAASC,kBAAkBA,CAACC,IAAY,EAAgB;EAC3D,MAAMC,MAAM,GAAGJ,yBAAyB,CAAC,CAAC;EAC1C,MAAMK,SAAS,GAAG,IAAIC,SAAS,CAAC,CAAC;EACjC,MAAMC,KAAK,GAAGH,MAAM,CAACC,SAAS,CAACG,eAAe,CAACL,IAAI,EAAE,WAAW,CAAC,CAAC;EAElE,IAAI,CAACI,KAAK,EAAE;IACR,MAAM,IAAIE,KAAK,CAAC,0CAA0C,CAAC;EAC/D;EAEA,MAAMC,SAAS,GAAGC,IAAI,CAACC,SAAS,CAACL,KAAK,CAAC;EAEvC,MAAMM,WAAW,GAAGZ,6BAA6B,CAAC,CAAC;EACnD,MAAMa,IAAI,GAAGD,WAAW,CAACE,MAAM,CAACL,SAAS,CAAC;EAE1C,OAAO;IAAEH,KAAK,EAAEG,SAAS;IAAEI;EAAK,CAAC;AACrC","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- import type { IFieldVM } from "../../../features/formModel/index.js";
3
- export declare const TextRenderer: React.FunctionComponent<{
4
- field: IFieldVM;
5
- }>;
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","observer","Input","DelayedOnChange","TextRenderer","field","createElement","value","onChange","label","placeholder","required","disabled","validation","onBlur"],"sources":["TextRenderer.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Input } from \"@webiny/admin-ui\";\nimport { DelayedOnChange } from \"@webiny/admin-ui\";\nimport type { IFieldVM } from \"~/features/formModel/index.js\";\n\nexport const TextRenderer = observer(function TextRenderer({ field }: { field: IFieldVM }) {\n return (\n <DelayedOnChange value={field.value} onChange={value => field.onChange(value)}>\n <Input\n label={field.label}\n placeholder={field.placeholder}\n required={field.required}\n disabled={field.disabled}\n validation={field.validation}\n onBlur={() => field.onBlur()}\n />\n </DelayedOnChange>\n );\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,KAAK,QAAQ,kBAAkB;AACxC,SAASC,eAAe,QAAQ,kBAAkB;AAGlD,OAAO,MAAMC,YAAY,GAAGH,QAAQ,CAAC,SAASG,YAAYA,CAAC;EAAEC;AAA2B,CAAC,EAAE;EACvF,oBACIL,KAAA,CAAAM,aAAA,CAACH,eAAe;IAACI,KAAK,EAAEF,KAAK,CAACE,KAAM;IAACC,QAAQ,EAAED,KAAK,IAAIF,KAAK,CAACG,QAAQ,CAACD,KAAK;EAAE,gBAC1EP,KAAA,CAAAM,aAAA,CAACJ,KAAK;IACFO,KAAK,EAAEJ,KAAK,CAACI,KAAM;IACnBC,WAAW,EAAEL,KAAK,CAACK,WAAY;IAC/BC,QAAQ,EAAEN,KAAK,CAACM,QAAS;IACzBC,QAAQ,EAAEP,KAAK,CAACO,QAAS;IACzBC,UAAU,EAAER,KAAK,CAACQ,UAAW;IAC7BC,MAAM,EAAEA,CAAA,KAAMT,KAAK,CAACS,MAAM,CAAC;EAAE,CAChC,CACY,CAAC;AAE1B,CAAC,CAAC","ignoreList":[]}