@btst/stack 2.4.0 → 2.5.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.
- package/dist/node_modules/.pnpm/{@tiptap_core@3.15.3_@tiptap_pm@3.15.3 → @tiptap_core@3.20.0_@tiptap_pm@3.15.3}/node_modules/@tiptap/core/dist/index.cjs +68 -8
- package/dist/node_modules/.pnpm/{@tiptap_core@3.15.3_@tiptap_pm@3.15.3 → @tiptap_core@3.20.0_@tiptap_pm@3.15.3}/node_modules/@tiptap/core/dist/index.mjs +68 -8
- package/dist/node_modules/.pnpm/{@tiptap_extension-blockquote@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-blockquote@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-blockquote/dist/index.cjs +2 -2
- package/dist/node_modules/.pnpm/{@tiptap_extension-blockquote@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-blockquote@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-blockquote/dist/index.mjs +2 -2
- package/dist/node_modules/.pnpm/{@tiptap_extension-bold@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-bold@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-bold/dist/index.cjs +2 -2
- package/dist/node_modules/.pnpm/{@tiptap_extension-bold@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-bold@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-bold/dist/index.mjs +2 -2
- package/dist/node_modules/.pnpm/{@tiptap_extension-bubble-menu@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-bubble-menu@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-bubble-menu/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-bubble-menu@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-bubble-menu@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-bubble-menu/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-code-block-lowlight@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@ti_2245ac34d84b5693aa60775b0f7781e3 → @tiptap_extension-code-block-lowlight@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@ti_360e739196c451ebf408f4af5a9f3f24}/node_modules/@tiptap/extension-code-block-lowlight/dist/index.cjs +2 -2
- package/dist/node_modules/.pnpm/{@tiptap_extension-code-block-lowlight@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@ti_2245ac34d84b5693aa60775b0f7781e3 → @tiptap_extension-code-block-lowlight@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@ti_360e739196c451ebf408f4af5a9f3f24}/node_modules/@tiptap/extension-code-block-lowlight/dist/index.mjs +2 -2
- package/dist/node_modules/.pnpm/@tiptap_extension-code-block@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3/node_modules/@tiptap/extension-code-block/dist/index.cjs +319 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-code-block@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3/node_modules/@tiptap/extension-code-block/dist/index.mjs +315 -0
- package/dist/node_modules/.pnpm/{@tiptap_extension-code-block@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-code-block@3.20.0_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-code-block/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-code-block@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-code-block@3.20.0_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-code-block/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-code@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-code@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-code/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-code@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-code@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-code/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-document@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-document@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-document/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-document@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-document@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-document/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-floating-menu@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-floating-menu@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-floating-menu/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-floating-menu@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-floating-menu@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-floating-menu/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-hard-break@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-hard-break@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-hard-break/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-hard-break@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-hard-break@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-hard-break/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-heading@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-heading@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-heading/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-heading@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-heading@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-heading/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-horizontal-rule@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-horizontal-rule@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-horizontal-rule/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-horizontal-rule@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-horizontal-rule@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-horizontal-rule/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-image@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-image@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-image/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-image@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-image@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-image/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-italic@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-italic@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-italic/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-italic@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-italic@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-italic/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-link@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-link@3.20.0_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-link/dist/index.cjs +28 -22
- package/dist/node_modules/.pnpm/{@tiptap_extension-link@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-link@3.20.0_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-link/dist/index.mjs +28 -22
- package/dist/node_modules/.pnpm/{@tiptap_extension-list@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-list@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-list/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-list@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-list@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-list/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-paragraph@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-paragraph@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-paragraph/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-paragraph@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-paragraph@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-paragraph/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-strike@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-strike@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-strike/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-strike@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-strike@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-strike/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-table@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-table@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-table/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-table@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extension-table@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extension-table/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-text-style@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-text-style@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-text-style/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-text-style@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-text-style@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-text-style/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-text@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-text@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-text/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-text@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-text@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-text/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-typography@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-typography@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-typography/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-typography@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-typography@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-typography/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-underline@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-underline@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-underline/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extension-underline@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3_ → @tiptap_extension-underline@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3_}/node_modules/@tiptap/extension-underline/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extensions@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extensions@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extensions/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_extensions@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_extensions@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/extensions/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_markdown@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_markdown@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/markdown/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_markdown@3.15.3_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3 → @tiptap_markdown@3.15.3_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tiptap_pm@3.15.3}/node_modules/@tiptap/markdown/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_react@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tip_d7a2a9a319317617a8908309649a6dda → @tiptap_react@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tip_b42b5b2d59902d8a01cd4cc3e2d5dc64}/node_modules/@tiptap/react/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@tiptap_react@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tip_d7a2a9a319317617a8908309649a6dda → @tiptap_react@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tip_b42b5b2d59902d8a01cd4cc3e2d5dc64}/node_modules/@tiptap/react/dist/index.mjs +2 -2
- package/dist/node_modules/.pnpm/{@tiptap_react@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tip_d7a2a9a319317617a8908309649a6dda → @tiptap_react@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tip_b42b5b2d59902d8a01cd4cc3e2d5dc64}/node_modules/@tiptap/react/dist/menus/index.cjs +2 -2
- package/dist/node_modules/.pnpm/{@tiptap_react@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.15.3_@tiptap_pm@3.15.3__@tip_d7a2a9a319317617a8908309649a6dda → @tiptap_react@3.15.3_@floating-ui_dom@1.7.4_@tiptap_core@3.20.0_@tiptap_pm@3.15.3__@tip_b42b5b2d59902d8a01cd4cc3e2d5dc64}/node_modules/@tiptap/react/dist/menus/index.mjs +2 -2
- package/dist/node_modules/.pnpm/@tiptap_starter-kit@3.15.3/node_modules/@tiptap/starter-kit/dist/index.cjs +17 -17
- package/dist/node_modules/.pnpm/@tiptap_starter-kit@3.15.3/node_modules/@tiptap/starter-kit/dist/index.mjs +17 -17
- package/dist/packages/stack/src/plugins/ai-chat/api/plugin.cjs +33 -47
- package/dist/packages/stack/src/plugins/ai-chat/api/plugin.mjs +33 -47
- package/dist/packages/stack/src/plugins/ai-chat/client/plugin.cjs +14 -21
- package/dist/packages/stack/src/plugins/ai-chat/client/plugin.mjs +15 -22
- package/dist/packages/stack/src/plugins/blog/api/plugin.cjs +28 -45
- package/dist/packages/stack/src/plugins/blog/api/plugin.mjs +22 -39
- package/dist/packages/stack/src/plugins/blog/client/plugin.cjs +23 -27
- package/dist/packages/stack/src/plugins/blog/client/plugin.mjs +24 -28
- package/dist/packages/stack/src/plugins/cms/api/plugin.cjs +14 -17
- package/dist/packages/stack/src/plugins/cms/api/plugin.mjs +14 -17
- package/dist/packages/stack/src/plugins/cms/client/plugin.cjs +11 -15
- package/dist/packages/stack/src/plugins/cms/client/plugin.mjs +12 -16
- package/dist/packages/stack/src/plugins/form-builder/api/plugin.cjs +58 -62
- package/dist/packages/stack/src/plugins/form-builder/api/plugin.mjs +58 -62
- package/dist/packages/stack/src/plugins/form-builder/client/plugin.cjs +12 -12
- package/dist/packages/stack/src/plugins/form-builder/client/plugin.mjs +13 -13
- package/dist/packages/stack/src/plugins/kanban/api/plugin.cjs +86 -117
- package/dist/packages/stack/src/plugins/kanban/api/plugin.mjs +83 -114
- package/dist/packages/stack/src/plugins/kanban/client/plugin.cjs +22 -29
- package/dist/packages/stack/src/plugins/kanban/client/plugin.mjs +23 -30
- package/dist/packages/stack/src/plugins/open-api/api/generator.cjs +2 -1
- package/dist/packages/stack/src/plugins/open-api/api/generator.mjs +2 -1
- package/dist/packages/stack/src/plugins/ui-builder/client/plugin.cjs +8 -8
- package/dist/packages/stack/src/plugins/ui-builder/client/plugin.mjs +9 -9
- package/dist/packages/stack/src/plugins/utils.cjs +42 -0
- package/dist/packages/stack/src/plugins/utils.mjs +41 -1
- package/dist/packages/ui/src/components/minimal-tiptap/components/bubble-menu/link-bubble-menu.cjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/components/bubble-menu/link-bubble-menu.mjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.cjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.mjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/color/color.cjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/color/color.mjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/file-handler/index.cjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/file-handler/index.mjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/horizontal-rule/horizontal-rule.cjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/horizontal-rule/horizontal-rule.mjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/image/components/image-view-block.cjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/image/components/image-view-block.mjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/image/image.cjs +2 -2
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/image/image.mjs +2 -2
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/markdown-paste/markdown-paste.cjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/markdown-paste/markdown-paste.mjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/reset-marks-on-enter/reset-marks-on-enter.cjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/reset-marks-on-enter/reset-marks-on-enter.mjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/unset-all-marks/unset-all-marks.cjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/extensions/unset-all-marks/unset-all-marks.mjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/hooks/use-minimal-tiptap.cjs +7 -7
- package/dist/packages/ui/src/components/minimal-tiptap/hooks/use-minimal-tiptap.mjs +7 -7
- package/dist/packages/ui/src/components/minimal-tiptap/hooks/use-tiptap-editor.cjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/hooks/use-tiptap-editor.mjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/minimal-tiptap.cjs +1 -1
- package/dist/packages/ui/src/components/minimal-tiptap/minimal-tiptap.mjs +1 -1
- package/dist/plugins/ai-chat/api/index.d.cts +1 -1
- package/dist/plugins/ai-chat/api/index.d.mts +1 -1
- package/dist/plugins/ai-chat/api/index.d.ts +1 -1
- package/dist/plugins/ai-chat/client/hooks/index.d.cts +1 -1
- package/dist/plugins/ai-chat/client/hooks/index.d.mts +1 -1
- package/dist/plugins/ai-chat/client/hooks/index.d.ts +1 -1
- package/dist/plugins/ai-chat/client/index.d.cts +8 -8
- package/dist/plugins/ai-chat/client/index.d.mts +8 -8
- package/dist/plugins/ai-chat/client/index.d.ts +8 -8
- package/dist/plugins/ai-chat/query-keys.d.cts +1 -1
- package/dist/plugins/ai-chat/query-keys.d.mts +1 -1
- package/dist/plugins/ai-chat/query-keys.d.ts +1 -1
- package/dist/plugins/blog/api/index.d.cts +1 -1
- package/dist/plugins/blog/api/index.d.mts +1 -1
- package/dist/plugins/blog/api/index.d.ts +1 -1
- package/dist/plugins/blog/client/index.d.cts +12 -12
- package/dist/plugins/blog/client/index.d.mts +12 -12
- package/dist/plugins/blog/client/index.d.ts +12 -12
- package/dist/plugins/blog/query-keys.d.cts +1 -1
- package/dist/plugins/blog/query-keys.d.mts +1 -1
- package/dist/plugins/blog/query-keys.d.ts +1 -1
- package/dist/plugins/client/index.cjs +1 -0
- package/dist/plugins/client/index.d.cts +8 -1
- package/dist/plugins/client/index.d.mts +8 -1
- package/dist/plugins/client/index.d.ts +8 -1
- package/dist/plugins/client/index.mjs +1 -1
- package/dist/plugins/cms/api/index.d.cts +2 -2
- package/dist/plugins/cms/api/index.d.mts +2 -2
- package/dist/plugins/cms/api/index.d.ts +2 -2
- package/dist/plugins/cms/client/hooks/index.d.cts +1 -1
- package/dist/plugins/cms/client/hooks/index.d.mts +1 -1
- package/dist/plugins/cms/client/hooks/index.d.ts +1 -1
- package/dist/plugins/cms/client/index.d.cts +6 -6
- package/dist/plugins/cms/client/index.d.mts +6 -6
- package/dist/plugins/cms/client/index.d.ts +6 -6
- package/dist/plugins/cms/query-keys.d.cts +2 -2
- package/dist/plugins/cms/query-keys.d.mts +2 -2
- package/dist/plugins/cms/query-keys.d.ts +2 -2
- package/dist/plugins/form-builder/api/index.d.cts +2 -2
- package/dist/plugins/form-builder/api/index.d.mts +2 -2
- package/dist/plugins/form-builder/api/index.d.ts +2 -2
- package/dist/plugins/form-builder/client/components/index.d.cts +1 -1
- package/dist/plugins/form-builder/client/components/index.d.mts +1 -1
- package/dist/plugins/form-builder/client/components/index.d.ts +1 -1
- package/dist/plugins/form-builder/client/hooks/index.d.cts +1 -1
- package/dist/plugins/form-builder/client/hooks/index.d.mts +1 -1
- package/dist/plugins/form-builder/client/hooks/index.d.ts +1 -1
- package/dist/plugins/form-builder/client/index.d.cts +6 -6
- package/dist/plugins/form-builder/client/index.d.mts +6 -6
- package/dist/plugins/form-builder/client/index.d.ts +6 -6
- package/dist/plugins/form-builder/query-keys.d.cts +2 -2
- package/dist/plugins/form-builder/query-keys.d.mts +2 -2
- package/dist/plugins/form-builder/query-keys.d.ts +2 -2
- package/dist/plugins/kanban/api/index.d.cts +1 -1
- package/dist/plugins/kanban/api/index.d.mts +1 -1
- package/dist/plugins/kanban/api/index.d.ts +1 -1
- package/dist/plugins/kanban/client/index.d.cts +12 -12
- package/dist/plugins/kanban/client/index.d.mts +12 -12
- package/dist/plugins/kanban/client/index.d.ts +12 -12
- package/dist/plugins/kanban/query-keys.d.cts +1 -1
- package/dist/plugins/kanban/query-keys.d.mts +1 -1
- package/dist/plugins/kanban/query-keys.d.ts +1 -1
- package/dist/plugins/ui-builder/client/hooks/index.d.cts +1 -1
- package/dist/plugins/ui-builder/client/hooks/index.d.mts +1 -1
- package/dist/plugins/ui-builder/client/hooks/index.d.ts +1 -1
- package/dist/plugins/ui-builder/client/index.d.cts +3 -3
- package/dist/plugins/ui-builder/client/index.d.mts +3 -3
- package/dist/plugins/ui-builder/client/index.d.ts +3 -3
- package/dist/plugins/ui-builder/index.d.cts +2 -2
- package/dist/plugins/ui-builder/index.d.mts +2 -2
- package/dist/plugins/ui-builder/index.d.ts +2 -2
- package/dist/shared/{stack.C-WUPMT6.d.cts → stack.B2xZTSiO.d.cts} +4 -4
- package/dist/shared/{stack.CczspVn2.d.mts → stack.B58oHdqm.d.mts} +1 -1
- package/dist/shared/{stack.BepFXT3w.d.mts → stack.B8D4r97Z.d.mts} +22 -22
- package/dist/shared/{stack.CVDTkMoO.d.mts → stack.B8QD11QU.d.cts} +7 -7
- package/dist/shared/{stack.CVDTkMoO.d.cts → stack.B8QD11QU.d.mts} +7 -7
- package/dist/shared/{stack.CVDTkMoO.d.ts → stack.B8QD11QU.d.ts} +7 -7
- package/dist/shared/{stack.kcdnD4gA.d.cts → stack.BgTmujxW.d.mts} +1 -1
- package/dist/shared/{stack.DdI5W6MB.d.mts → stack.BozPgbrZ.d.cts} +19 -19
- package/dist/shared/{stack.DdI5W6MB.d.ts → stack.BozPgbrZ.d.mts} +19 -19
- package/dist/shared/{stack.DdI5W6MB.d.cts → stack.BozPgbrZ.d.ts} +19 -19
- package/dist/shared/{stack.BUkC2EsZ.d.cts → stack.C9Mg2Q46.d.cts} +1 -1
- package/dist/shared/{stack.Kq2-QzOC.d.ts → stack.CLQuVdwK.d.ts} +1 -1
- package/dist/shared/{stack.B7ONvlD_.d.mts → stack.CSx98K5H.d.cts} +1 -1
- package/dist/shared/{stack.BEn34wW6.d.ts → stack.CTDVxbrA.d.ts} +12 -12
- package/dist/shared/{stack.C-Ptrz8s.d.ts → stack.Cj_zKww4.d.ts} +4 -4
- package/dist/shared/{stack.DWoCZff7.d.cts → stack.D-b5zbPm.d.cts} +12 -12
- package/dist/shared/{stack.CL8ts1Mu.d.ts → stack.DXnclTG7.d.ts} +8 -8
- package/dist/shared/{stack.heOA9gzA.d.cts → stack.DaZM10cp.d.cts} +8 -8
- package/dist/shared/{stack.CgWzG5jH.d.ts → stack.DgKOwl20.d.ts} +22 -22
- package/dist/shared/{stack.DTDxgFj8.d.mts → stack.FVWf2JhZ.d.mts} +12 -12
- package/dist/shared/{stack.Dk5r4W1F.d.mts → stack.cfCkioTe.d.mts} +8 -8
- package/dist/shared/{stack.6fUOjLs9.d.mts → stack.dH7u-TJH.d.mts} +4 -4
- package/dist/shared/{stack.DASmUVjX.d.ts → stack.sO33ZDhK.d.ts} +1 -1
- package/dist/shared/{stack.D3GB6wKv.d.cts → stack.uWSqCWAb.d.cts} +22 -22
- package/package.json +1 -1
- package/src/plugins/ai-chat/api/plugin.ts +48 -63
- package/src/plugins/ai-chat/client/plugin.tsx +23 -31
- package/src/plugins/blog/api/plugin.ts +31 -47
- package/src/plugins/blog/client/plugin.tsx +36 -39
- package/src/plugins/client/index.ts +5 -1
- package/src/plugins/cms/api/plugin.ts +14 -17
- package/src/plugins/cms/client/plugin.tsx +18 -21
- package/src/plugins/cms/types.ts +7 -7
- package/src/plugins/form-builder/api/plugin.ts +64 -64
- package/src/plugins/form-builder/client/plugin.tsx +19 -18
- package/src/plugins/form-builder/types.ts +19 -24
- package/src/plugins/kanban/api/plugin.ts +111 -136
- package/src/plugins/kanban/client/plugin.tsx +35 -41
- package/src/plugins/open-api/api/generator.ts +3 -1
- package/src/plugins/ui-builder/client/plugin.tsx +11 -10
- package/src/plugins/ui-builder/types.ts +4 -4
- package/src/plugins/utils.ts +92 -1
- /package/dist/node_modules/.pnpm/{@tiptap_core@3.15.3_@tiptap_pm@3.15.3 → @tiptap_core@3.20.0_@tiptap_pm@3.15.3}/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@tiptap_core@3.15.3_@tiptap_pm@3.15.3 → @tiptap_core@3.20.0_@tiptap_pm@3.15.3}/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.mjs +0 -0
|
@@ -8,6 +8,7 @@ const schemas = require('../schemas.cjs');
|
|
|
8
8
|
const utils = require('../utils.cjs');
|
|
9
9
|
const getters = require('./getters.cjs');
|
|
10
10
|
const queryKeyDefs = require('./query-key-defs.cjs');
|
|
11
|
+
const utils$1 = require('../../utils.cjs');
|
|
11
12
|
|
|
12
13
|
function createFormBuilderPrefetchForRoute(adapter) {
|
|
13
14
|
return async function prefetchForRoute(key, qc, params) {
|
|
@@ -98,10 +99,11 @@ const formBuilderBackendPlugin = (config = {}) => api.defineBackendPlugin({
|
|
|
98
99
|
const { status, limit, offset } = ctx.query;
|
|
99
100
|
const context = createContext(ctx.headers);
|
|
100
101
|
if (config.hooks?.onBeforeListForms) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
await utils$1.runHookWithShim(
|
|
103
|
+
() => config.hooks.onBeforeListForms(context),
|
|
104
|
+
ctx.error,
|
|
105
|
+
"Access denied"
|
|
106
|
+
);
|
|
105
107
|
}
|
|
106
108
|
return getters.getAllForms(adapter, { status, limit, offset });
|
|
107
109
|
}
|
|
@@ -116,10 +118,11 @@ const formBuilderBackendPlugin = (config = {}) => api.defineBackendPlugin({
|
|
|
116
118
|
const { slug } = ctx.params;
|
|
117
119
|
const context = createContext(ctx.headers);
|
|
118
120
|
if (config.hooks?.onBeforeGetForm) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
await utils$1.runHookWithShim(
|
|
122
|
+
() => config.hooks.onBeforeGetForm(slug, context),
|
|
123
|
+
ctx.error,
|
|
124
|
+
"Access denied"
|
|
125
|
+
);
|
|
123
126
|
}
|
|
124
127
|
const form = await getters.getFormBySlug(adapter, slug);
|
|
125
128
|
if (!form) {
|
|
@@ -138,10 +141,11 @@ const formBuilderBackendPlugin = (config = {}) => api.defineBackendPlugin({
|
|
|
138
141
|
const { id } = ctx.params;
|
|
139
142
|
const context = createContext(ctx.headers);
|
|
140
143
|
if (config.hooks?.onBeforeGetForm) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
await utils$1.runHookWithShim(
|
|
145
|
+
() => config.hooks.onBeforeGetForm(id, context),
|
|
146
|
+
ctx.error,
|
|
147
|
+
"Access denied"
|
|
148
|
+
);
|
|
145
149
|
}
|
|
146
150
|
const form = await adapter.findOne({
|
|
147
151
|
model: "form",
|
|
@@ -192,15 +196,13 @@ const formBuilderBackendPlugin = (config = {}) => api.defineBackendPlugin({
|
|
|
192
196
|
status: body.status
|
|
193
197
|
};
|
|
194
198
|
if (config.hooks?.onBeforeFormCreated) {
|
|
195
|
-
const
|
|
196
|
-
formInput,
|
|
197
|
-
|
|
199
|
+
const hookResult = await utils$1.runHookWithShim(
|
|
200
|
+
() => config.hooks.onBeforeFormCreated(formInput, context),
|
|
201
|
+
ctx.error,
|
|
202
|
+
"Create operation denied"
|
|
198
203
|
);
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
if (result && typeof result === "object") {
|
|
203
|
-
formInput = result;
|
|
204
|
+
if (hookResult && typeof hookResult === "object") {
|
|
205
|
+
formInput = hookResult;
|
|
204
206
|
}
|
|
205
207
|
}
|
|
206
208
|
const form = await adapter.create({
|
|
@@ -282,16 +284,13 @@ const formBuilderBackendPlugin = (config = {}) => api.defineBackendPlugin({
|
|
|
282
284
|
status: body.status
|
|
283
285
|
};
|
|
284
286
|
if (config.hooks?.onBeforeFormUpdated) {
|
|
285
|
-
const
|
|
286
|
-
id,
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
const hookResult = await utils$1.runHookWithShim(
|
|
288
|
+
() => config.hooks.onBeforeFormUpdated(id, updateInput, context),
|
|
289
|
+
ctx.error,
|
|
290
|
+
"Update operation denied"
|
|
289
291
|
);
|
|
290
|
-
if (
|
|
291
|
-
|
|
292
|
-
}
|
|
293
|
-
if (result && typeof result === "object") {
|
|
294
|
-
updateInput = result;
|
|
292
|
+
if (hookResult && typeof hookResult === "object") {
|
|
293
|
+
updateInput = hookResult;
|
|
295
294
|
}
|
|
296
295
|
}
|
|
297
296
|
const updateData = {
|
|
@@ -343,13 +342,11 @@ const formBuilderBackendPlugin = (config = {}) => api.defineBackendPlugin({
|
|
|
343
342
|
throw ctx.error(404, { message: "Form not found" });
|
|
344
343
|
}
|
|
345
344
|
if (config.hooks?.onBeforeFormDeleted) {
|
|
346
|
-
|
|
347
|
-
id,
|
|
348
|
-
|
|
345
|
+
await utils$1.runHookWithShim(
|
|
346
|
+
() => config.hooks.onBeforeFormDeleted(id, context),
|
|
347
|
+
ctx.error,
|
|
348
|
+
"Delete operation denied"
|
|
349
349
|
);
|
|
350
|
-
if (!canDelete) {
|
|
351
|
-
throw ctx.error(403, { message: "Delete operation denied" });
|
|
352
|
-
}
|
|
353
350
|
}
|
|
354
351
|
await adapter.delete({
|
|
355
352
|
model: "formSubmission",
|
|
@@ -414,28 +411,33 @@ const formBuilderBackendPlugin = (config = {}) => api.defineBackendPlugin({
|
|
|
414
411
|
}
|
|
415
412
|
let finalData = data;
|
|
416
413
|
if (config.hooks?.onBeforeSubmission) {
|
|
414
|
+
let hookResult;
|
|
415
|
+
let originalError;
|
|
417
416
|
try {
|
|
418
|
-
|
|
417
|
+
hookResult = await config.hooks.onBeforeSubmission(
|
|
419
418
|
slug,
|
|
420
419
|
data,
|
|
421
420
|
submissionContext
|
|
422
421
|
);
|
|
423
|
-
if (
|
|
424
|
-
|
|
425
|
-
}
|
|
426
|
-
if (result && typeof result === "object") {
|
|
427
|
-
finalData = result;
|
|
422
|
+
if (hookResult === false) {
|
|
423
|
+
originalError = new Error("Submission rejected");
|
|
428
424
|
}
|
|
429
|
-
} catch (
|
|
425
|
+
} catch (e) {
|
|
426
|
+
originalError = e instanceof Error ? e : new Error("Submission rejected");
|
|
427
|
+
}
|
|
428
|
+
if (originalError) {
|
|
430
429
|
if (config.hooks?.onSubmissionError) {
|
|
431
430
|
await config.hooks.onSubmissionError(
|
|
432
|
-
|
|
431
|
+
originalError,
|
|
433
432
|
slug,
|
|
434
433
|
data,
|
|
435
434
|
submissionContext
|
|
436
435
|
);
|
|
437
436
|
}
|
|
438
|
-
throw error;
|
|
437
|
+
throw ctx.error(400, { message: originalError.message });
|
|
438
|
+
}
|
|
439
|
+
if (hookResult && typeof hookResult === "object") {
|
|
440
|
+
finalData = hookResult;
|
|
439
441
|
}
|
|
440
442
|
}
|
|
441
443
|
const submission = await adapter.create({
|
|
@@ -484,13 +486,11 @@ const formBuilderBackendPlugin = (config = {}) => api.defineBackendPlugin({
|
|
|
484
486
|
throw ctx.error(404, { message: "Form not found" });
|
|
485
487
|
}
|
|
486
488
|
if (config.hooks?.onBeforeListSubmissions) {
|
|
487
|
-
|
|
488
|
-
formId,
|
|
489
|
-
|
|
489
|
+
await utils$1.runHookWithShim(
|
|
490
|
+
() => config.hooks.onBeforeListSubmissions(formId, context),
|
|
491
|
+
ctx.error,
|
|
492
|
+
"Access denied"
|
|
490
493
|
);
|
|
491
|
-
if (!canList) {
|
|
492
|
-
throw ctx.error(403, { message: "Access denied" });
|
|
493
|
-
}
|
|
494
494
|
}
|
|
495
495
|
return getters.getFormSubmissions(adapter, formId, { limit, offset });
|
|
496
496
|
}
|
|
@@ -505,13 +505,11 @@ const formBuilderBackendPlugin = (config = {}) => api.defineBackendPlugin({
|
|
|
505
505
|
const { formId, subId } = ctx.params;
|
|
506
506
|
const context = createContext(ctx.headers);
|
|
507
507
|
if (config.hooks?.onBeforeGetSubmission) {
|
|
508
|
-
|
|
509
|
-
subId,
|
|
510
|
-
|
|
508
|
+
await utils$1.runHookWithShim(
|
|
509
|
+
() => config.hooks.onBeforeGetSubmission(subId, context),
|
|
510
|
+
ctx.error,
|
|
511
|
+
"Access denied"
|
|
511
512
|
);
|
|
512
|
-
if (!canGet) {
|
|
513
|
-
throw ctx.error(403, { message: "Access denied" });
|
|
514
|
-
}
|
|
515
513
|
}
|
|
516
514
|
const submission = await adapter.findOne({
|
|
517
515
|
model: "formSubmission",
|
|
@@ -541,13 +539,11 @@ const formBuilderBackendPlugin = (config = {}) => api.defineBackendPlugin({
|
|
|
541
539
|
throw ctx.error(404, { message: "Submission not found" });
|
|
542
540
|
}
|
|
543
541
|
if (config.hooks?.onBeforeSubmissionDeleted) {
|
|
544
|
-
|
|
545
|
-
subId,
|
|
546
|
-
|
|
542
|
+
await utils$1.runHookWithShim(
|
|
543
|
+
() => config.hooks.onBeforeSubmissionDeleted(subId, context),
|
|
544
|
+
ctx.error,
|
|
545
|
+
"Delete operation denied"
|
|
547
546
|
);
|
|
548
|
-
if (!canDelete) {
|
|
549
|
-
throw ctx.error(403, { message: "Delete operation denied" });
|
|
550
|
-
}
|
|
551
547
|
}
|
|
552
548
|
await adapter.delete({
|
|
553
549
|
model: "formSubmission",
|
|
@@ -6,6 +6,7 @@ import { listFormsQuerySchema, createFormSchema, updateFormSchema, listSubmissio
|
|
|
6
6
|
import { extractUserAgent, extractIpAddress, slugify } from '../utils.mjs';
|
|
7
7
|
import { getFormSubmissions, getFormBySlug, getFormById, getAllForms, serializeForm, serializeFormSubmission, serializeFormSubmissionWithData } from './getters.mjs';
|
|
8
8
|
import { FORM_QUERY_KEYS } from './query-key-defs.mjs';
|
|
9
|
+
import { runHookWithShim } from '../../utils.mjs';
|
|
9
10
|
|
|
10
11
|
function createFormBuilderPrefetchForRoute(adapter) {
|
|
11
12
|
return async function prefetchForRoute(key, qc, params) {
|
|
@@ -96,10 +97,11 @@ const formBuilderBackendPlugin = (config = {}) => defineBackendPlugin({
|
|
|
96
97
|
const { status, limit, offset } = ctx.query;
|
|
97
98
|
const context = createContext(ctx.headers);
|
|
98
99
|
if (config.hooks?.onBeforeListForms) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
await runHookWithShim(
|
|
101
|
+
() => config.hooks.onBeforeListForms(context),
|
|
102
|
+
ctx.error,
|
|
103
|
+
"Access denied"
|
|
104
|
+
);
|
|
103
105
|
}
|
|
104
106
|
return getAllForms(adapter, { status, limit, offset });
|
|
105
107
|
}
|
|
@@ -114,10 +116,11 @@ const formBuilderBackendPlugin = (config = {}) => defineBackendPlugin({
|
|
|
114
116
|
const { slug } = ctx.params;
|
|
115
117
|
const context = createContext(ctx.headers);
|
|
116
118
|
if (config.hooks?.onBeforeGetForm) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
await runHookWithShim(
|
|
120
|
+
() => config.hooks.onBeforeGetForm(slug, context),
|
|
121
|
+
ctx.error,
|
|
122
|
+
"Access denied"
|
|
123
|
+
);
|
|
121
124
|
}
|
|
122
125
|
const form = await getFormBySlug(adapter, slug);
|
|
123
126
|
if (!form) {
|
|
@@ -136,10 +139,11 @@ const formBuilderBackendPlugin = (config = {}) => defineBackendPlugin({
|
|
|
136
139
|
const { id } = ctx.params;
|
|
137
140
|
const context = createContext(ctx.headers);
|
|
138
141
|
if (config.hooks?.onBeforeGetForm) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
142
|
+
await runHookWithShim(
|
|
143
|
+
() => config.hooks.onBeforeGetForm(id, context),
|
|
144
|
+
ctx.error,
|
|
145
|
+
"Access denied"
|
|
146
|
+
);
|
|
143
147
|
}
|
|
144
148
|
const form = await adapter.findOne({
|
|
145
149
|
model: "form",
|
|
@@ -190,15 +194,13 @@ const formBuilderBackendPlugin = (config = {}) => defineBackendPlugin({
|
|
|
190
194
|
status: body.status
|
|
191
195
|
};
|
|
192
196
|
if (config.hooks?.onBeforeFormCreated) {
|
|
193
|
-
const
|
|
194
|
-
formInput,
|
|
195
|
-
|
|
197
|
+
const hookResult = await runHookWithShim(
|
|
198
|
+
() => config.hooks.onBeforeFormCreated(formInput, context),
|
|
199
|
+
ctx.error,
|
|
200
|
+
"Create operation denied"
|
|
196
201
|
);
|
|
197
|
-
if (
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
if (result && typeof result === "object") {
|
|
201
|
-
formInput = result;
|
|
202
|
+
if (hookResult && typeof hookResult === "object") {
|
|
203
|
+
formInput = hookResult;
|
|
202
204
|
}
|
|
203
205
|
}
|
|
204
206
|
const form = await adapter.create({
|
|
@@ -280,16 +282,13 @@ const formBuilderBackendPlugin = (config = {}) => defineBackendPlugin({
|
|
|
280
282
|
status: body.status
|
|
281
283
|
};
|
|
282
284
|
if (config.hooks?.onBeforeFormUpdated) {
|
|
283
|
-
const
|
|
284
|
-
id,
|
|
285
|
-
|
|
286
|
-
|
|
285
|
+
const hookResult = await runHookWithShim(
|
|
286
|
+
() => config.hooks.onBeforeFormUpdated(id, updateInput, context),
|
|
287
|
+
ctx.error,
|
|
288
|
+
"Update operation denied"
|
|
287
289
|
);
|
|
288
|
-
if (
|
|
289
|
-
|
|
290
|
-
}
|
|
291
|
-
if (result && typeof result === "object") {
|
|
292
|
-
updateInput = result;
|
|
290
|
+
if (hookResult && typeof hookResult === "object") {
|
|
291
|
+
updateInput = hookResult;
|
|
293
292
|
}
|
|
294
293
|
}
|
|
295
294
|
const updateData = {
|
|
@@ -341,13 +340,11 @@ const formBuilderBackendPlugin = (config = {}) => defineBackendPlugin({
|
|
|
341
340
|
throw ctx.error(404, { message: "Form not found" });
|
|
342
341
|
}
|
|
343
342
|
if (config.hooks?.onBeforeFormDeleted) {
|
|
344
|
-
|
|
345
|
-
id,
|
|
346
|
-
|
|
343
|
+
await runHookWithShim(
|
|
344
|
+
() => config.hooks.onBeforeFormDeleted(id, context),
|
|
345
|
+
ctx.error,
|
|
346
|
+
"Delete operation denied"
|
|
347
347
|
);
|
|
348
|
-
if (!canDelete) {
|
|
349
|
-
throw ctx.error(403, { message: "Delete operation denied" });
|
|
350
|
-
}
|
|
351
348
|
}
|
|
352
349
|
await adapter.delete({
|
|
353
350
|
model: "formSubmission",
|
|
@@ -412,28 +409,33 @@ const formBuilderBackendPlugin = (config = {}) => defineBackendPlugin({
|
|
|
412
409
|
}
|
|
413
410
|
let finalData = data;
|
|
414
411
|
if (config.hooks?.onBeforeSubmission) {
|
|
412
|
+
let hookResult;
|
|
413
|
+
let originalError;
|
|
415
414
|
try {
|
|
416
|
-
|
|
415
|
+
hookResult = await config.hooks.onBeforeSubmission(
|
|
417
416
|
slug,
|
|
418
417
|
data,
|
|
419
418
|
submissionContext
|
|
420
419
|
);
|
|
421
|
-
if (
|
|
422
|
-
|
|
423
|
-
}
|
|
424
|
-
if (result && typeof result === "object") {
|
|
425
|
-
finalData = result;
|
|
420
|
+
if (hookResult === false) {
|
|
421
|
+
originalError = new Error("Submission rejected");
|
|
426
422
|
}
|
|
427
|
-
} catch (
|
|
423
|
+
} catch (e) {
|
|
424
|
+
originalError = e instanceof Error ? e : new Error("Submission rejected");
|
|
425
|
+
}
|
|
426
|
+
if (originalError) {
|
|
428
427
|
if (config.hooks?.onSubmissionError) {
|
|
429
428
|
await config.hooks.onSubmissionError(
|
|
430
|
-
|
|
429
|
+
originalError,
|
|
431
430
|
slug,
|
|
432
431
|
data,
|
|
433
432
|
submissionContext
|
|
434
433
|
);
|
|
435
434
|
}
|
|
436
|
-
throw error;
|
|
435
|
+
throw ctx.error(400, { message: originalError.message });
|
|
436
|
+
}
|
|
437
|
+
if (hookResult && typeof hookResult === "object") {
|
|
438
|
+
finalData = hookResult;
|
|
437
439
|
}
|
|
438
440
|
}
|
|
439
441
|
const submission = await adapter.create({
|
|
@@ -482,13 +484,11 @@ const formBuilderBackendPlugin = (config = {}) => defineBackendPlugin({
|
|
|
482
484
|
throw ctx.error(404, { message: "Form not found" });
|
|
483
485
|
}
|
|
484
486
|
if (config.hooks?.onBeforeListSubmissions) {
|
|
485
|
-
|
|
486
|
-
formId,
|
|
487
|
-
|
|
487
|
+
await runHookWithShim(
|
|
488
|
+
() => config.hooks.onBeforeListSubmissions(formId, context),
|
|
489
|
+
ctx.error,
|
|
490
|
+
"Access denied"
|
|
488
491
|
);
|
|
489
|
-
if (!canList) {
|
|
490
|
-
throw ctx.error(403, { message: "Access denied" });
|
|
491
|
-
}
|
|
492
492
|
}
|
|
493
493
|
return getFormSubmissions(adapter, formId, { limit, offset });
|
|
494
494
|
}
|
|
@@ -503,13 +503,11 @@ const formBuilderBackendPlugin = (config = {}) => defineBackendPlugin({
|
|
|
503
503
|
const { formId, subId } = ctx.params;
|
|
504
504
|
const context = createContext(ctx.headers);
|
|
505
505
|
if (config.hooks?.onBeforeGetSubmission) {
|
|
506
|
-
|
|
507
|
-
subId,
|
|
508
|
-
|
|
506
|
+
await runHookWithShim(
|
|
507
|
+
() => config.hooks.onBeforeGetSubmission(subId, context),
|
|
508
|
+
ctx.error,
|
|
509
|
+
"Access denied"
|
|
509
510
|
);
|
|
510
|
-
if (!canGet) {
|
|
511
|
-
throw ctx.error(403, { message: "Access denied" });
|
|
512
|
-
}
|
|
513
511
|
}
|
|
514
512
|
const submission = await adapter.findOne({
|
|
515
513
|
model: "formSubmission",
|
|
@@ -539,13 +537,11 @@ const formBuilderBackendPlugin = (config = {}) => defineBackendPlugin({
|
|
|
539
537
|
throw ctx.error(404, { message: "Submission not found" });
|
|
540
538
|
}
|
|
541
539
|
if (config.hooks?.onBeforeSubmissionDeleted) {
|
|
542
|
-
|
|
543
|
-
subId,
|
|
544
|
-
|
|
540
|
+
await runHookWithShim(
|
|
541
|
+
() => config.hooks.onBeforeSubmissionDeleted(subId, context),
|
|
542
|
+
ctx.error,
|
|
543
|
+
"Delete operation denied"
|
|
545
544
|
);
|
|
546
|
-
if (!canDelete) {
|
|
547
|
-
throw ctx.error(403, { message: "Delete operation denied" });
|
|
548
|
-
}
|
|
549
545
|
}
|
|
550
546
|
await adapter.delete({
|
|
551
547
|
model: "formSubmission",
|
|
@@ -34,10 +34,10 @@ function createFormListLoader(config) {
|
|
|
34
34
|
};
|
|
35
35
|
try {
|
|
36
36
|
if (hooks?.beforeLoadFormList) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
await client.runClientHookWithShim(
|
|
38
|
+
() => hooks.beforeLoadFormList(context),
|
|
39
|
+
"Load prevented by beforeLoadFormList hook"
|
|
40
|
+
);
|
|
41
41
|
}
|
|
42
42
|
const client$1 = client.createApiClient({
|
|
43
43
|
baseURL: apiBaseURL,
|
|
@@ -96,10 +96,10 @@ function createFormBuilderLoader(id, config) {
|
|
|
96
96
|
};
|
|
97
97
|
try {
|
|
98
98
|
if (hooks?.beforeLoadFormBuilder) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
await client.runClientHookWithShim(
|
|
100
|
+
() => hooks.beforeLoadFormBuilder(id, context),
|
|
101
|
+
"Load prevented by beforeLoadFormBuilder hook"
|
|
102
|
+
);
|
|
103
103
|
}
|
|
104
104
|
const client$1 = client.createApiClient({
|
|
105
105
|
baseURL: apiBaseURL,
|
|
@@ -148,10 +148,10 @@ function createSubmissionsLoader(formId, config) {
|
|
|
148
148
|
};
|
|
149
149
|
try {
|
|
150
150
|
if (hooks?.beforeLoadSubmissions) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
await client.runClientHookWithShim(
|
|
152
|
+
() => hooks.beforeLoadSubmissions(formId, context),
|
|
153
|
+
"Load prevented by beforeLoadSubmissions hook"
|
|
154
|
+
);
|
|
155
155
|
}
|
|
156
156
|
const client$1 = client.createApiClient({
|
|
157
157
|
baseURL: apiBaseURL,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { lazy } from 'react';
|
|
3
|
-
import { defineClientPlugin, createApiClient, isConnectionError } from '@btst/stack/plugins/client';
|
|
3
|
+
import { defineClientPlugin, createApiClient, runClientHookWithShim, isConnectionError } from '@btst/stack/plugins/client';
|
|
4
4
|
import { createRoute } from '@btst/yar';
|
|
5
5
|
import { createFormBuilderQueryKeys } from '../../../../../../plugins/form-builder/query-keys.mjs';
|
|
6
6
|
|
|
@@ -32,10 +32,10 @@ function createFormListLoader(config) {
|
|
|
32
32
|
};
|
|
33
33
|
try {
|
|
34
34
|
if (hooks?.beforeLoadFormList) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
await runClientHookWithShim(
|
|
36
|
+
() => hooks.beforeLoadFormList(context),
|
|
37
|
+
"Load prevented by beforeLoadFormList hook"
|
|
38
|
+
);
|
|
39
39
|
}
|
|
40
40
|
const client = createApiClient({
|
|
41
41
|
baseURL: apiBaseURL,
|
|
@@ -94,10 +94,10 @@ function createFormBuilderLoader(id, config) {
|
|
|
94
94
|
};
|
|
95
95
|
try {
|
|
96
96
|
if (hooks?.beforeLoadFormBuilder) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
await runClientHookWithShim(
|
|
98
|
+
() => hooks.beforeLoadFormBuilder(id, context),
|
|
99
|
+
"Load prevented by beforeLoadFormBuilder hook"
|
|
100
|
+
);
|
|
101
101
|
}
|
|
102
102
|
const client = createApiClient({
|
|
103
103
|
baseURL: apiBaseURL,
|
|
@@ -146,10 +146,10 @@ function createSubmissionsLoader(formId, config) {
|
|
|
146
146
|
};
|
|
147
147
|
try {
|
|
148
148
|
if (hooks?.beforeLoadSubmissions) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
149
|
+
await runClientHookWithShim(
|
|
150
|
+
() => hooks.beforeLoadSubmissions(formId, context),
|
|
151
|
+
"Load prevented by beforeLoadSubmissions hook"
|
|
152
|
+
);
|
|
153
153
|
}
|
|
154
154
|
const client = createApiClient({
|
|
155
155
|
baseURL: apiBaseURL,
|