@carlonicora/nextjs-jsonapi 1.109.0 → 1.111.0
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/{AssistantMessageInterface-Cs1yb-gF.d.ts → AssistantMessageInterface-BNzf1etU.d.ts} +14 -1
- package/dist/{AssistantMessageInterface-DQ3mH5L8.d.mts → AssistantMessageInterface-DrgHDjZ5.d.mts} +14 -1
- package/dist/{BlockNoteEditor-3XYBZLWO.js → BlockNoteEditor-7OKW6HHN.js} +19 -20
- package/dist/BlockNoteEditor-7OKW6HHN.js.map +1 -0
- package/dist/{BlockNoteEditor-EBFZG7AL.mjs → BlockNoteEditor-K7IIWM3S.mjs} +4 -5
- package/dist/{BlockNoteEditor-EBFZG7AL.mjs.map → BlockNoteEditor-K7IIWM3S.mjs.map} +1 -1
- package/dist/BlockNoteViewer-OPSCTHKJ.mjs +31 -0
- package/dist/BlockNoteViewer-OPSCTHKJ.mjs.map +1 -0
- package/dist/BlockNoteViewer-UW5VZ5UF.js +31 -0
- package/dist/BlockNoteViewer-UW5VZ5UF.js.map +1 -0
- package/dist/billing/index.d.mts +41 -41
- package/dist/billing/index.d.ts +41 -41
- package/dist/billing/index.js +346 -347
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +3 -4
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-7E3O52U5.js → chunk-6XWW67F2.js} +25 -12
- package/dist/chunk-6XWW67F2.js.map +1 -0
- package/dist/{chunk-UHO3KUUH.js → chunk-AKXUNE3A.js} +977 -850
- package/dist/chunk-AKXUNE3A.js.map +1 -0
- package/dist/{chunk-UOYIWJEJ.mjs → chunk-CWVYU4YZ.mjs} +18 -5
- package/dist/{chunk-UOYIWJEJ.mjs.map → chunk-CWVYU4YZ.mjs.map} +1 -1
- package/dist/{chunk-CRTVAQEK.mjs → chunk-TXVVZLUQ.mjs} +1388 -1261
- package/dist/chunk-TXVVZLUQ.mjs.map +1 -0
- package/dist/{chunk-CFI4WZ5R.js → chunk-U2HR57MY.js} +111 -5
- package/dist/chunk-U2HR57MY.js.map +1 -0
- package/dist/chunk-WPAQRB5Q.mjs +7 -0
- package/dist/chunk-WPAQRB5Q.mjs.map +1 -0
- package/dist/chunk-YBZVWLPH.js +7 -0
- package/dist/chunk-YBZVWLPH.js.map +1 -0
- package/dist/{chunk-MSNNAHDB.mjs → chunk-ZYPNVEHB.mjs} +112 -6
- package/dist/{chunk-MSNNAHDB.mjs.map → chunk-ZYPNVEHB.mjs.map} +1 -1
- package/dist/client/index.d.mts +3 -4
- package/dist/client/index.d.ts +3 -4
- package/dist/client/index.js +4 -5
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +3 -4
- package/dist/components/index.d.mts +418 -415
- package/dist/components/index.d.ts +418 -415
- package/dist/components/index.js +6 -5
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +5 -4
- package/dist/{config-CN23v3eJ.d.ts → config-BrkU_Ynz.d.ts} +2 -2
- package/dist/{config-gh88Qn4h.d.mts → config-snd2ToEB.d.mts} +2 -2
- package/dist/contexts/index.d.mts +15 -15
- package/dist/contexts/index.d.ts +15 -15
- package/dist/contexts/index.js +4 -5
- package/dist/contexts/index.js.map +1 -1
- package/dist/contexts/index.mjs +3 -4
- package/dist/core/index.d.mts +35 -4
- package/dist/core/index.d.ts +35 -4
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/features/help/index.d.mts +25 -66
- package/dist/features/help/index.d.ts +25 -66
- package/dist/features/help/index.js +114 -124
- package/dist/features/help/index.js.map +1 -1
- package/dist/features/help/index.mjs +95 -105
- package/dist/features/help/index.mjs.map +1 -1
- package/dist/features/help/server.d.mts +27 -65
- package/dist/features/help/server.d.ts +27 -65
- package/dist/features/help/server.js +4 -119
- package/dist/features/help/server.js.map +1 -1
- package/dist/features/help/server.mjs +4 -119
- package/dist/features/help/server.mjs.map +1 -1
- package/dist/help-content-config.interface-C5ESIod9.d.mts +13 -0
- package/dist/help-content-config.interface-C5ESIod9.d.ts +13 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -3
- package/dist/scripts/generate-web-module/__tests__/container.spec.d.ts +2 -0
- package/dist/scripts/generate-web-module/__tests__/container.spec.d.ts.map +1 -0
- package/dist/scripts/generate-web-module/__tests__/container.spec.js +54 -0
- package/dist/scripts/generate-web-module/__tests__/container.spec.js.map +1 -0
- package/dist/scripts/generate-web-module/__tests__/data-service.spec.d.ts +2 -0
- package/dist/scripts/generate-web-module/__tests__/data-service.spec.d.ts.map +1 -0
- package/dist/scripts/generate-web-module/__tests__/data-service.spec.js +19 -0
- package/dist/scripts/generate-web-module/__tests__/data-service.spec.js.map +1 -0
- package/dist/scripts/generate-web-module/__tests__/editor.spec.d.ts +2 -0
- package/dist/scripts/generate-web-module/__tests__/editor.spec.d.ts.map +1 -0
- package/dist/scripts/generate-web-module/__tests__/editor.spec.js +35 -0
- package/dist/scripts/generate-web-module/__tests__/editor.spec.js.map +1 -0
- package/dist/scripts/generate-web-module/__tests__/fixtures.d.ts +4 -0
- package/dist/scripts/generate-web-module/__tests__/fixtures.d.ts.map +1 -0
- package/dist/scripts/generate-web-module/__tests__/fixtures.js +45 -0
- package/dist/scripts/generate-web-module/__tests__/fixtures.js.map +1 -0
- package/dist/scripts/generate-web-module/__tests__/model-interface.spec.d.ts +2 -0
- package/dist/scripts/generate-web-module/__tests__/model-interface.spec.d.ts.map +1 -0
- package/dist/scripts/generate-web-module/__tests__/model-interface.spec.js +74 -0
- package/dist/scripts/generate-web-module/__tests__/model-interface.spec.js.map +1 -0
- package/dist/scripts/generate-web-module/__tests__/plumbing.spec.d.ts +2 -0
- package/dist/scripts/generate-web-module/__tests__/plumbing.spec.d.ts.map +1 -0
- package/dist/scripts/generate-web-module/__tests__/plumbing.spec.js +21 -0
- package/dist/scripts/generate-web-module/__tests__/plumbing.spec.js.map +1 -0
- package/dist/scripts/generate-web-module/__tests__/selector.spec.d.ts +2 -0
- package/dist/scripts/generate-web-module/__tests__/selector.spec.d.ts.map +1 -0
- package/dist/scripts/generate-web-module/__tests__/selector.spec.js +25 -0
- package/dist/scripts/generate-web-module/__tests__/selector.spec.js.map +1 -0
- package/dist/scripts/generate-web-module/__tests__/table-module-list.spec.d.ts +2 -0
- package/dist/scripts/generate-web-module/__tests__/table-module-list.spec.d.ts.map +1 -0
- package/dist/scripts/generate-web-module/__tests__/table-module-list.spec.js +55 -0
- package/dist/scripts/generate-web-module/__tests__/table-module-list.spec.js.map +1 -0
- package/dist/scripts/generate-web-module/generator.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/generator.js +14 -11
- package/dist/scripts/generate-web-module/generator.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/container.template.d.ts +5 -1
- package/dist/scripts/generate-web-module/templates/components/container.template.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/container.template.js +43 -63
- package/dist/scripts/generate-web-module/templates/components/container.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/content.template.d.ts +7 -4
- package/dist/scripts/generate-web-module/templates/components/content.template.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/content.template.js +103 -14
- package/dist/scripts/generate-web-module/templates/components/content.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/editor.template.d.ts +1 -1
- package/dist/scripts/generate-web-module/templates/components/editor.template.js +139 -150
- package/dist/scripts/generate-web-module/templates/components/editor.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/index.d.ts +0 -1
- package/dist/scripts/generate-web-module/templates/components/index.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/index.js +1 -3
- package/dist/scripts/generate-web-module/templates/components/index.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/list-container.template.js +2 -2
- package/dist/scripts/generate-web-module/templates/components/list.template.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/list.template.js +6 -1
- package/dist/scripts/generate-web-module/templates/components/list.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/selector.template.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/selector.template.js +48 -52
- package/dist/scripts/generate-web-module/templates/components/selector.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/data/interface.template.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/templates/data/interface.template.js +38 -11
- package/dist/scripts/generate-web-module/templates/data/interface.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/data/model.template.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/templates/data/model.template.js +83 -26
- package/dist/scripts/generate-web-module/templates/data/model.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/data/service.template.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/templates/data/service.template.js +21 -1
- package/dist/scripts/generate-web-module/templates/data/service.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/index.d.ts +1 -1
- package/dist/scripts/generate-web-module/templates/index.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/templates/index.js +1 -2
- package/dist/scripts/generate-web-module/templates/index.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/module.template.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/templates/module.template.js +11 -3
- package/dist/scripts/generate-web-module/templates/module.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/table-hook.template.js +31 -1
- package/dist/scripts/generate-web-module/templates/table-hook.template.js.map +1 -1
- package/dist/scripts/generate-web-module/transformers/import-resolver.d.ts +0 -1
- package/dist/scripts/generate-web-module/transformers/import-resolver.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/transformers/import-resolver.js +0 -1
- package/dist/scripts/generate-web-module/transformers/import-resolver.js.map +1 -1
- package/dist/scripts/generate-web-module/transformers/relationship-key.d.ts +5 -0
- package/dist/scripts/generate-web-module/transformers/relationship-key.d.ts.map +1 -0
- package/dist/scripts/generate-web-module/transformers/relationship-key.js +21 -0
- package/dist/scripts/generate-web-module/transformers/relationship-key.js.map +1 -0
- package/dist/scripts/generate-web-module/transformers/relationship-resolver.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/transformers/relationship-resolver.js +2 -0
- package/dist/scripts/generate-web-module/transformers/relationship-resolver.js.map +1 -1
- package/dist/scripts/generate-web-module/types/json-schema.interface.d.ts +21 -0
- package/dist/scripts/generate-web-module/types/json-schema.interface.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/types/template-data.interface.d.ts +17 -0
- package/dist/scripts/generate-web-module/types/template-data.interface.d.ts.map +1 -1
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/dist/testing/index.d.mts +1 -2
- package/dist/testing/index.d.ts +1 -2
- package/package.json +1 -6
- package/scripts/generate-web-module/__tests__/container.spec.ts +58 -0
- package/scripts/generate-web-module/__tests__/data-service.spec.ts +18 -0
- package/scripts/generate-web-module/__tests__/editor.spec.ts +36 -0
- package/scripts/generate-web-module/__tests__/fixtures.ts +43 -0
- package/scripts/generate-web-module/__tests__/model-interface.spec.ts +77 -0
- package/scripts/generate-web-module/__tests__/plumbing.spec.ts +21 -0
- package/scripts/generate-web-module/__tests__/selector.spec.ts +24 -0
- package/scripts/generate-web-module/__tests__/table-module-list.spec.ts +59 -0
- package/scripts/generate-web-module/generator.ts +14 -13
- package/scripts/generate-web-module/templates/components/container.template.ts +51 -66
- package/scripts/generate-web-module/templates/components/content.template.ts +107 -15
- package/scripts/generate-web-module/templates/components/editor.template.ts +140 -152
- package/scripts/generate-web-module/templates/components/index.ts +0 -1
- package/scripts/generate-web-module/templates/components/list-container.template.ts +2 -2
- package/scripts/generate-web-module/templates/components/list.template.ts +6 -1
- package/scripts/generate-web-module/templates/components/selector.template.ts +48 -52
- package/scripts/generate-web-module/templates/data/interface.template.ts +44 -12
- package/scripts/generate-web-module/templates/data/model.template.ts +88 -28
- package/scripts/generate-web-module/templates/data/service.template.ts +23 -1
- package/scripts/generate-web-module/templates/index.ts +0 -1
- package/scripts/generate-web-module/templates/module.template.ts +13 -3
- package/scripts/generate-web-module/templates/table-hook.template.ts +31 -2
- package/scripts/generate-web-module/transformers/import-resolver.ts +0 -2
- package/scripts/generate-web-module/transformers/relationship-key.ts +18 -0
- package/scripts/generate-web-module/transformers/relationship-resolver.ts +2 -0
- package/scripts/generate-web-module/types/json-schema.interface.ts +9 -0
- package/scripts/generate-web-module/types/template-data.interface.ts +7 -0
- package/src/client/config.ts +1 -1
- package/src/components/index.ts +1 -0
- package/src/components/viewers/BlockNoteViewer.tsx +27 -0
- package/src/components/viewers/BlockNoteViewerContainer.tsx +10 -0
- package/src/core/registry/helpStore.ts +2 -19
- package/src/features/assistant-message/components/parts/MessageSourcesContainer.tsx +4 -0
- package/src/features/assistant-message/components/parts/tabs/ContentsTab.tsx +5 -5
- package/src/features/assistant-message/components/parts/tabs/ReferencesTab.tsx +3 -2
- package/src/features/help/components/HelpArticleBody.tsx +27 -19
- package/src/features/help/components/HelpHint.tsx +20 -11
- package/src/features/help/components/HelpSearchResultRow.tsx +16 -6
- package/src/features/help/components/HelpSideNav.tsx +54 -19
- package/src/features/help/components/__tests__/HelpAskAi.spec.tsx +1 -1
- package/src/features/help/components/__tests__/HelpHint.spec.tsx +17 -17
- package/src/features/help/components/__tests__/HelpSearchResultRow.spec.tsx +18 -19
- package/src/features/help/components/__tests__/HelpSideNav.spec.tsx +20 -22
- package/src/features/help/contexts/HelpContext.spec.tsx +1 -3
- package/src/features/help/index.ts +3 -6
- package/src/features/help/interfaces/help-content-config.interface.ts +0 -5
- package/src/features/help/server-entry.ts +6 -15
- package/src/features/help/types/help-article.types.ts +2 -4
- package/src/features/how-to/HowToModule.ts +14 -1
- package/src/features/how-to/components/forms/HowToEditor.tsx +108 -4
- package/src/features/how-to/data/HowTo.spec.ts +43 -0
- package/src/features/how-to/data/HowTo.ts +47 -4
- package/src/features/how-to/data/HowToInterface.ts +14 -1
- package/src/features/how-to/data/HowToService.ts +61 -0
- package/dist/BlockNoteEditor-3XYBZLWO.js.map +0 -1
- package/dist/chunk-3J7RQBF3.js +0 -123
- package/dist/chunk-3J7RQBF3.js.map +0 -1
- package/dist/chunk-7E3O52U5.js.map +0 -1
- package/dist/chunk-CFI4WZ5R.js.map +0 -1
- package/dist/chunk-CQID6RCF.mjs +0 -38
- package/dist/chunk-CQID6RCF.mjs.map +0 -1
- package/dist/chunk-CRTVAQEK.mjs.map +0 -1
- package/dist/chunk-MZTKPPET.mjs +0 -123
- package/dist/chunk-MZTKPPET.mjs.map +0 -1
- package/dist/chunk-UHO3KUUH.js.map +0 -1
- package/dist/chunk-YQQHAFBS.js +0 -38
- package/dist/chunk-YQQHAFBS.js.map +0 -1
- package/dist/features/help/server/createHelpAssetRouteHandler.d.mts +0 -11
- package/dist/features/help/server/createHelpAssetRouteHandler.d.ts +0 -11
- package/dist/features/help/server/createHelpAssetRouteHandler.js +0 -43
- package/dist/features/help/server/createHelpAssetRouteHandler.js.map +0 -1
- package/dist/features/help/server/createHelpAssetRouteHandler.mjs +0 -43
- package/dist/features/help/server/createHelpAssetRouteHandler.mjs.map +0 -1
- package/dist/help-content-config.interface-B9L02u9i.d.mts +0 -50
- package/dist/help-content-config.interface-B9L02u9i.d.ts +0 -50
- package/dist/scripts/generate-web-module/templates/components/details.template.d.ts +0 -14
- package/dist/scripts/generate-web-module/templates/components/details.template.d.ts.map +0 -1
- package/dist/scripts/generate-web-module/templates/components/details.template.js +0 -112
- package/dist/scripts/generate-web-module/templates/components/details.template.js.map +0 -1
- package/scripts/generate-web-module/templates/components/details.template.ts +0 -116
- package/src/features/help/components/mdx/Callout.tsx +0 -21
- package/src/features/help/components/mdx/EntityRef.tsx +0 -18
- package/src/features/help/components/mdx/KeyBinding.tsx +0 -6
- package/src/features/help/components/mdx/Related.tsx +0 -33
- package/src/features/help/components/mdx/Screenshot.tsx +0 -9
- package/src/features/help/components/mdx/Steps.tsx +0 -21
- package/src/features/help/components/mdx/Video.tsx +0 -8
- package/src/features/help/components/mdx/mdx-server-components.ts +0 -23
- package/src/features/help/components/mdx/mdxComponents.ts +0 -9
- package/src/features/help/hooks/useHelpArticle.ts +0 -7
- package/src/features/help/hooks/useHelpManifest.ts +0 -5
- package/src/features/help/server/__tests__/createHelpAssetRouteHandler.spec.ts +0 -43
- package/src/features/help/server/createHelpAssetRouteHandler.ts +0 -35
- package/src/features/help/server/generateHelpArticleMetadata.ts +0 -18
- package/src/features/help/server/generateHelpArticleStaticParams.ts +0 -7
- package/src/features/help/server/generateHelpModeStaticParams.ts +0 -5
- package/src/features/help/server/getHelpContent.ts +0 -17
- package/src/features/help/server/index.ts +0 -8
- package/src/features/help/server/serializeHelpArticle.tsx +0 -46
- package/src/features/help/utils/__tests__/helpNavigation.spec.ts +0 -70
- package/src/features/help/utils/helpNavigation.ts +0 -29
package/dist/chunk-YQQHAFBS.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
-
|
|
3
|
-
var _chunk7QVYU63Ejs = require('./chunk-7QVYU63E.js');
|
|
4
|
-
|
|
5
|
-
// src/core/registry/helpStore.ts
|
|
6
|
-
var HELP_CONTENT_KEY = /* @__PURE__ */ Symbol.for("nextjs-jsonapi:helpContent");
|
|
7
|
-
var HELP_READER_KEY = /* @__PURE__ */ Symbol.for("nextjs-jsonapi:helpReader");
|
|
8
|
-
var globalStore = globalThis;
|
|
9
|
-
if (globalStore[HELP_CONTENT_KEY] === void 0) {
|
|
10
|
-
globalStore[HELP_CONTENT_KEY] = null;
|
|
11
|
-
}
|
|
12
|
-
if (globalStore[HELP_READER_KEY] === void 0) {
|
|
13
|
-
globalStore[HELP_READER_KEY] = null;
|
|
14
|
-
}
|
|
15
|
-
function _setStaticHelpContent(cfg) {
|
|
16
|
-
globalStore[HELP_CONTENT_KEY] = cfg;
|
|
17
|
-
}
|
|
18
|
-
_chunk7QVYU63Ejs.__name.call(void 0, _setStaticHelpContent, "_setStaticHelpContent");
|
|
19
|
-
function _getStaticHelpContent() {
|
|
20
|
-
return _nullishCoalesce(globalStore[HELP_CONTENT_KEY], () => ( null));
|
|
21
|
-
}
|
|
22
|
-
_chunk7QVYU63Ejs.__name.call(void 0, _getStaticHelpContent, "_getStaticHelpContent");
|
|
23
|
-
function setHelpReader(reader) {
|
|
24
|
-
globalStore[HELP_READER_KEY] = reader;
|
|
25
|
-
}
|
|
26
|
-
_chunk7QVYU63Ejs.__name.call(void 0, setHelpReader, "setHelpReader");
|
|
27
|
-
function _getStaticHelpReader() {
|
|
28
|
-
return _nullishCoalesce(globalStore[HELP_READER_KEY], () => ( null));
|
|
29
|
-
}
|
|
30
|
-
_chunk7QVYU63Ejs.__name.call(void 0, _getStaticHelpReader, "_getStaticHelpReader");
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
exports._setStaticHelpContent = _setStaticHelpContent; exports._getStaticHelpContent = _getStaticHelpContent; exports.setHelpReader = setHelpReader; exports._getStaticHelpReader = _getStaticHelpReader;
|
|
38
|
-
//# sourceMappingURL=chunk-YQQHAFBS.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/chunk-YQQHAFBS.js","../src/core/registry/helpStore.ts"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACA;ACWA,IAAM,iBAAA,kBAAmB,MAAA,CAAO,GAAA,CAAI,4BAA4B,CAAA;AAChE,IAAM,gBAAA,kBAAkB,MAAA,CAAO,GAAA,CAAI,2BAA2B,CAAA;AAE9D,IAAM,YAAA,EAAc,UAAA;AAKpB,GAAA,CAAI,WAAA,CAAY,gBAAgB,EAAA,IAAM,KAAA,CAAA,EAAW;AAC/C,EAAA,WAAA,CAAY,gBAAgB,EAAA,EAAI,IAAA;AAClC;AACA,GAAA,CAAI,WAAA,CAAY,eAAe,EAAA,IAAM,KAAA,CAAA,EAAW;AAC9C,EAAA,WAAA,CAAY,eAAe,EAAA,EAAI,IAAA;AACjC;AAEO,SAAS,qBAAA,CAAsB,GAAA,EAA2B;AAC/D,EAAA,WAAA,CAAY,gBAAgB,EAAA,EAAI,GAAA;AAClC;AAFgB,qCAAA,qBAAA,EAAA,uBAAA,CAAA;AAIT,SAAS,qBAAA,CAAA,EAA+C;AAC7D,EAAA,wBAAQ,WAAA,CAAY,gBAAgB,CAAA,UAAkB,MAAA;AACxD;AAFgB,qCAAA,qBAAA,EAAA,uBAAA,CAAA;AAIT,SAAS,aAAA,CAAc,MAAA,EAA0B;AACtD,EAAA,WAAA,CAAY,eAAe,EAAA,EAAI,MAAA;AACjC;AAFgB,qCAAA,aAAA,EAAA,eAAA,CAAA;AAIT,SAAS,oBAAA,CAAA,EAA0C;AACxD,EAAA,wBAAO,WAAA,CAAY,eAAe,CAAA,UAAK,MAAA;AACzC;AAFgB,qCAAA,oBAAA,EAAA,sBAAA,CAAA;ADZhB;AACA;AACE;AACA;AACA;AACA;AACF,yMAAC","file":"/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/chunk-YQQHAFBS.js","sourcesContent":[null,"/**\n * Centralized help-content store accessible from client and server contexts.\n * Uses globalThis Symbol keys to persist across HMR/Turbopack reloads and to\n * bridge between the client-side `configureJsonApi` (in `client/config.ts`)\n * and server-side consumers (HelpProvider, getHelpContent, serializeHelpArticle).\n *\n * NO external dependencies to avoid circular imports.\n *\n * Pattern mirrors `bootstrapStore.ts`.\n */\n\n// Help content config shape is duplicated here as `unknown` to avoid pulling\n// the help feature into this core file. Callers cast on read.\ntype HelpReader = (article: { path: string }) => Promise<string>;\n\nconst HELP_CONTENT_KEY = Symbol.for(\"nextjs-jsonapi:helpContent\");\nconst HELP_READER_KEY = Symbol.for(\"nextjs-jsonapi:helpReader\");\n\nconst globalStore = globalThis as unknown as {\n [HELP_CONTENT_KEY]?: unknown | null;\n [HELP_READER_KEY]?: HelpReader | null;\n};\n\nif (globalStore[HELP_CONTENT_KEY] === undefined) {\n globalStore[HELP_CONTENT_KEY] = null;\n}\nif (globalStore[HELP_READER_KEY] === undefined) {\n globalStore[HELP_READER_KEY] = null;\n}\n\nexport function _setStaticHelpContent(cfg: unknown | null): void {\n globalStore[HELP_CONTENT_KEY] = cfg;\n}\n\nexport function _getStaticHelpContent<T = unknown>(): T | null {\n return (globalStore[HELP_CONTENT_KEY] as T | null) ?? null;\n}\n\nexport function setHelpReader(reader: HelpReader): void {\n globalStore[HELP_READER_KEY] = reader;\n}\n\nexport function _getStaticHelpReader(): HelpReader | null {\n return globalStore[HELP_READER_KEY] ?? null;\n}\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from 'next/server';
|
|
2
|
-
|
|
3
|
-
declare function createHelpAssetRouteHandler({ srcRoot }: {
|
|
4
|
-
srcRoot: string;
|
|
5
|
-
}): (_req: Request, { params }: {
|
|
6
|
-
params: Promise<{
|
|
7
|
-
path: string[];
|
|
8
|
-
}>;
|
|
9
|
-
}) => Promise<NextResponse<unknown>>;
|
|
10
|
-
|
|
11
|
-
export { createHelpAssetRouteHandler };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from 'next/server';
|
|
2
|
-
|
|
3
|
-
declare function createHelpAssetRouteHandler({ srcRoot }: {
|
|
4
|
-
srcRoot: string;
|
|
5
|
-
}): (_req: Request, { params }: {
|
|
6
|
-
params: Promise<{
|
|
7
|
-
path: string[];
|
|
8
|
-
}>;
|
|
9
|
-
}) => Promise<NextResponse<unknown>>;
|
|
10
|
-
|
|
11
|
-
export { createHelpAssetRouteHandler };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
-
|
|
3
|
-
var _chunk7QVYU63Ejs = require('../../../chunk-7QVYU63E.js');
|
|
4
|
-
|
|
5
|
-
// src/features/help/server/createHelpAssetRouteHandler.ts
|
|
6
|
-
var _server = require('next/server');
|
|
7
|
-
var _promises = require('fs/promises');
|
|
8
|
-
var _path = require('path');
|
|
9
|
-
var MIME = {
|
|
10
|
-
".png": "image/png",
|
|
11
|
-
".jpg": "image/jpeg",
|
|
12
|
-
".jpeg": "image/jpeg",
|
|
13
|
-
".webp": "image/webp",
|
|
14
|
-
".gif": "image/gif",
|
|
15
|
-
".svg": "image/svg+xml",
|
|
16
|
-
".mp4": "video/mp4",
|
|
17
|
-
".webm": "video/webm"
|
|
18
|
-
};
|
|
19
|
-
function createHelpAssetRouteHandler({ srcRoot }) {
|
|
20
|
-
return /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async function GET(_req, { params }) {
|
|
21
|
-
const { path } = await params;
|
|
22
|
-
const safe = path.filter((p) => p !== ".." && !p.includes("/")).join("/");
|
|
23
|
-
const filePath = _path.join.call(void 0, srcRoot, safe);
|
|
24
|
-
try {
|
|
25
|
-
const s = await _promises.stat.call(void 0, filePath);
|
|
26
|
-
if (!s.isFile()) return new (0, _server.NextResponse)("Not found", { status: 404 });
|
|
27
|
-
const ext = filePath.toLowerCase().slice(filePath.lastIndexOf("."));
|
|
28
|
-
const mime = _nullishCoalesce(MIME[ext], () => ( "application/octet-stream"));
|
|
29
|
-
const data = await _promises.readFile.call(void 0, filePath);
|
|
30
|
-
return new (0, _server.NextResponse)(data, {
|
|
31
|
-
status: 200,
|
|
32
|
-
headers: { "Content-Type": mime, "Cache-Control": "public, max-age=3600" }
|
|
33
|
-
});
|
|
34
|
-
} catch (e) {
|
|
35
|
-
return new (0, _server.NextResponse)("Not found", { status: 404 });
|
|
36
|
-
}
|
|
37
|
-
}, "GET");
|
|
38
|
-
}
|
|
39
|
-
_chunk7QVYU63Ejs.__name.call(void 0, createHelpAssetRouteHandler, "createHelpAssetRouteHandler");
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
exports.createHelpAssetRouteHandler = createHelpAssetRouteHandler;
|
|
43
|
-
//# sourceMappingURL=createHelpAssetRouteHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/features/help/server/createHelpAssetRouteHandler.js","../../../../src/features/help/server/createHelpAssetRouteHandler.ts"],"names":[],"mappings":"AAAA;AACE;AACF,6DAAmC;AACnC;AACA;ACJA,qCAA6B;AAC7B,uCAA+B;AAC/B,4BAAqB;AAErB,IAAM,KAAA,EAA+B;AAAA,EACnC,MAAA,EAAQ,WAAA;AAAA,EACR,MAAA,EAAQ,YAAA;AAAA,EACR,OAAA,EAAS,YAAA;AAAA,EACT,OAAA,EAAS,YAAA;AAAA,EACT,MAAA,EAAQ,WAAA;AAAA,EACR,MAAA,EAAQ,eAAA;AAAA,EACR,MAAA,EAAQ,WAAA;AAAA,EACR,OAAA,EAAS;AACX,CAAA;AAEO,SAAS,2BAAA,CAA4B,EAAE,QAAQ,CAAA,EAAwB;AAC5E,EAAA,uBAAO,qCAAA,MAAA,SAAe,GAAA,CAAI,IAAA,EAAe,EAAE,OAAO,CAAA,EAA4C;AAC5F,IAAA,MAAM,EAAE,KAAK,EAAA,EAAI,MAAM,MAAA;AACvB,IAAA,MAAM,KAAA,EAAO,IAAA,CAAK,MAAA,CAAO,CAAC,CAAA,EAAA,GAAM,EAAA,IAAM,KAAA,GAAQ,CAAC,CAAA,CAAE,QAAA,CAAS,GAAG,CAAC,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA;AACxE,IAAA,MAAM,SAAA,EAAW,wBAAA,OAAK,EAAS,IAAI,CAAA;AACnC,IAAA,IAAI;AACF,MAAA,MAAM,EAAA,EAAI,MAAM,4BAAA,QAAa,CAAA;AAC7B,MAAA,GAAA,CAAI,CAAC,CAAA,CAAE,MAAA,CAAO,CAAA,EAAG,OAAO,IAAI,yBAAA,CAAa,WAAA,EAAa,EAAE,MAAA,EAAQ,IAAI,CAAC,CAAA;AACrE,MAAA,MAAM,IAAA,EAAM,QAAA,CAAS,WAAA,CAAY,CAAA,CAAE,KAAA,CAAM,QAAA,CAAS,WAAA,CAAY,GAAG,CAAC,CAAA;AAClE,MAAA,MAAM,KAAA,mBAAO,IAAA,CAAK,GAAG,CAAA,UAAK,4BAAA;AAC1B,MAAA,MAAM,KAAA,EAAO,MAAM,gCAAA,QAAiB,CAAA;AACpC,MAAA,OAAO,IAAI,yBAAA,CAAa,IAAA,EAAM;AAAA,QAC5B,MAAA,EAAQ,GAAA;AAAA,QACR,OAAA,EAAS,EAAE,cAAA,EAAgB,IAAA,EAAM,eAAA,EAAiB,uBAAuB;AAAA,MAC3E,CAAC,CAAA;AAAA,IACH,EAAA,UAAQ;AACN,MAAA,OAAO,IAAI,yBAAA,CAAa,WAAA,EAAa,EAAE,MAAA,EAAQ,IAAI,CAAC,CAAA;AAAA,IACtD;AAAA,EACF,CAAA,EAjBO,KAAA,CAAA;AAkBT;AAnBgB,qCAAA,2BAAA,EAAA,6BAAA,CAAA;ADwBhB;AACE;AACF,kEAAC","file":"/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/features/help/server/createHelpAssetRouteHandler.js","sourcesContent":[null,"import { NextResponse } from \"next/server\";\nimport { readFile, stat } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nconst MIME: Record<string, string> = {\n \".png\": \"image/png\",\n \".jpg\": \"image/jpeg\",\n \".jpeg\": \"image/jpeg\",\n \".webp\": \"image/webp\",\n \".gif\": \"image/gif\",\n \".svg\": \"image/svg+xml\",\n \".mp4\": \"video/mp4\",\n \".webm\": \"video/webm\",\n};\n\nexport function createHelpAssetRouteHandler({ srcRoot }: { srcRoot: string }) {\n return async function GET(_req: Request, { params }: { params: Promise<{ path: string[] }> }) {\n const { path } = await params;\n const safe = path.filter((p) => p !== \"..\" && !p.includes(\"/\")).join(\"/\");\n const filePath = join(srcRoot, safe);\n try {\n const s = await stat(filePath);\n if (!s.isFile()) return new NextResponse(\"Not found\", { status: 404 });\n const ext = filePath.toLowerCase().slice(filePath.lastIndexOf(\".\"));\n const mime = MIME[ext] ?? \"application/octet-stream\";\n const data = await readFile(filePath);\n return new NextResponse(data, {\n status: 200,\n headers: { \"Content-Type\": mime, \"Cache-Control\": \"public, max-age=3600\" },\n });\n } catch {\n return new NextResponse(\"Not found\", { status: 404 });\n }\n };\n}\n"]}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__name
|
|
3
|
-
} from "../../../chunk-PAWJFY3S.mjs";
|
|
4
|
-
|
|
5
|
-
// src/features/help/server/createHelpAssetRouteHandler.ts
|
|
6
|
-
import { NextResponse } from "next/server";
|
|
7
|
-
import { readFile, stat } from "fs/promises";
|
|
8
|
-
import { join } from "path";
|
|
9
|
-
var MIME = {
|
|
10
|
-
".png": "image/png",
|
|
11
|
-
".jpg": "image/jpeg",
|
|
12
|
-
".jpeg": "image/jpeg",
|
|
13
|
-
".webp": "image/webp",
|
|
14
|
-
".gif": "image/gif",
|
|
15
|
-
".svg": "image/svg+xml",
|
|
16
|
-
".mp4": "video/mp4",
|
|
17
|
-
".webm": "video/webm"
|
|
18
|
-
};
|
|
19
|
-
function createHelpAssetRouteHandler({ srcRoot }) {
|
|
20
|
-
return /* @__PURE__ */ __name(async function GET(_req, { params }) {
|
|
21
|
-
const { path } = await params;
|
|
22
|
-
const safe = path.filter((p) => p !== ".." && !p.includes("/")).join("/");
|
|
23
|
-
const filePath = join(srcRoot, safe);
|
|
24
|
-
try {
|
|
25
|
-
const s = await stat(filePath);
|
|
26
|
-
if (!s.isFile()) return new NextResponse("Not found", { status: 404 });
|
|
27
|
-
const ext = filePath.toLowerCase().slice(filePath.lastIndexOf("."));
|
|
28
|
-
const mime = MIME[ext] ?? "application/octet-stream";
|
|
29
|
-
const data = await readFile(filePath);
|
|
30
|
-
return new NextResponse(data, {
|
|
31
|
-
status: 200,
|
|
32
|
-
headers: { "Content-Type": mime, "Cache-Control": "public, max-age=3600" }
|
|
33
|
-
});
|
|
34
|
-
} catch {
|
|
35
|
-
return new NextResponse("Not found", { status: 404 });
|
|
36
|
-
}
|
|
37
|
-
}, "GET");
|
|
38
|
-
}
|
|
39
|
-
__name(createHelpAssetRouteHandler, "createHelpAssetRouteHandler");
|
|
40
|
-
export {
|
|
41
|
-
createHelpAssetRouteHandler
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=createHelpAssetRouteHandler.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/features/help/server/createHelpAssetRouteHandler.ts"],"sourcesContent":["import { NextResponse } from \"next/server\";\nimport { readFile, stat } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nconst MIME: Record<string, string> = {\n \".png\": \"image/png\",\n \".jpg\": \"image/jpeg\",\n \".jpeg\": \"image/jpeg\",\n \".webp\": \"image/webp\",\n \".gif\": \"image/gif\",\n \".svg\": \"image/svg+xml\",\n \".mp4\": \"video/mp4\",\n \".webm\": \"video/webm\",\n};\n\nexport function createHelpAssetRouteHandler({ srcRoot }: { srcRoot: string }) {\n return async function GET(_req: Request, { params }: { params: Promise<{ path: string[] }> }) {\n const { path } = await params;\n const safe = path.filter((p) => p !== \"..\" && !p.includes(\"/\")).join(\"/\");\n const filePath = join(srcRoot, safe);\n try {\n const s = await stat(filePath);\n if (!s.isFile()) return new NextResponse(\"Not found\", { status: 404 });\n const ext = filePath.toLowerCase().slice(filePath.lastIndexOf(\".\"));\n const mime = MIME[ext] ?? \"application/octet-stream\";\n const data = await readFile(filePath);\n return new NextResponse(data, {\n status: 200,\n headers: { \"Content-Type\": mime, \"Cache-Control\": \"public, max-age=3600\" },\n });\n } catch {\n return new NextResponse(\"Not found\", { status: 404 });\n }\n };\n}\n"],"mappings":";;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,UAAU,YAAY;AAC/B,SAAS,YAAY;AAErB,IAAM,OAA+B;AAAA,EACnC,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AACX;AAEO,SAAS,4BAA4B,EAAE,QAAQ,GAAwB;AAC5E,SAAO,sCAAe,IAAI,MAAe,EAAE,OAAO,GAA4C;AAC5F,UAAM,EAAE,KAAK,IAAI,MAAM;AACvB,UAAM,OAAO,KAAK,OAAO,CAAC,MAAM,MAAM,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,EAAE,KAAK,GAAG;AACxE,UAAM,WAAW,KAAK,SAAS,IAAI;AACnC,QAAI;AACF,YAAM,IAAI,MAAM,KAAK,QAAQ;AAC7B,UAAI,CAAC,EAAE,OAAO,EAAG,QAAO,IAAI,aAAa,aAAa,EAAE,QAAQ,IAAI,CAAC;AACrE,YAAM,MAAM,SAAS,YAAY,EAAE,MAAM,SAAS,YAAY,GAAG,CAAC;AAClE,YAAM,OAAO,KAAK,GAAG,KAAK;AAC1B,YAAM,OAAO,MAAM,SAAS,QAAQ;AACpC,aAAO,IAAI,aAAa,MAAM;AAAA,QAC5B,QAAQ;AAAA,QACR,SAAS,EAAE,gBAAgB,MAAM,iBAAiB,uBAAuB;AAAA,MAC3E,CAAC;AAAA,IACH,QAAQ;AACN,aAAO,IAAI,aAAa,aAAa,EAAE,QAAQ,IAAI,CAAC;AAAA,IACtD;AAAA,EACF,GAjBO;AAkBT;AAnBgB;","names":[]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Local copy of the help-article types to keep this published frontend library
|
|
3
|
-
* decoupled from `@carlonicora/nestjs-neo4jsonapi`. Must stay in sync with
|
|
4
|
-
* `packages/nestjs-neo4jsonapi/src/foundations/help-content-sync/interfaces/help-article.interface.ts`.
|
|
5
|
-
*/
|
|
6
|
-
declare const HELP_MODES: readonly ["tutorial", "how-to", "reference", "explanation"];
|
|
7
|
-
type HelpMode = (typeof HELP_MODES)[number];
|
|
8
|
-
interface HelpHeading {
|
|
9
|
-
depth: 2 | 3;
|
|
10
|
-
slug: string;
|
|
11
|
-
text: string;
|
|
12
|
-
}
|
|
13
|
-
interface HelpArticle {
|
|
14
|
-
id: string;
|
|
15
|
-
slug: string;
|
|
16
|
-
mode: HelpMode;
|
|
17
|
-
title: string;
|
|
18
|
-
summary: string;
|
|
19
|
-
order: number;
|
|
20
|
-
tags: readonly string[];
|
|
21
|
-
contextualKeys: readonly string[];
|
|
22
|
-
aiIndexed: boolean;
|
|
23
|
-
draft: boolean;
|
|
24
|
-
contentHash: string;
|
|
25
|
-
path: string;
|
|
26
|
-
headings: readonly HelpHeading[];
|
|
27
|
-
relatedSlugs: readonly string[];
|
|
28
|
-
lastUpdated: string;
|
|
29
|
-
}
|
|
30
|
-
interface HelpRedirect {
|
|
31
|
-
from: string;
|
|
32
|
-
to: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
interface HelpBrandConfig {
|
|
36
|
-
/** URL of the brand logo image (served by the consuming app). */
|
|
37
|
-
logo?: string;
|
|
38
|
-
/** Brand label shown in the help header. */
|
|
39
|
-
label?: string;
|
|
40
|
-
/** Where the "Open app" button navigates for logged-in users. Defaults to "/". */
|
|
41
|
-
appHref?: string;
|
|
42
|
-
}
|
|
43
|
-
interface HelpContentConfig {
|
|
44
|
-
manifest: readonly HelpArticle[];
|
|
45
|
-
namespaceUuid: string;
|
|
46
|
-
redirects?: readonly HelpRedirect[];
|
|
47
|
-
brand?: HelpBrandConfig;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export { type HelpContentConfig as H, type HelpArticle as a, type HelpMode as b, type HelpBrandConfig as c, HELP_MODES as d, type HelpHeading as e, type HelpRedirect as f };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Local copy of the help-article types to keep this published frontend library
|
|
3
|
-
* decoupled from `@carlonicora/nestjs-neo4jsonapi`. Must stay in sync with
|
|
4
|
-
* `packages/nestjs-neo4jsonapi/src/foundations/help-content-sync/interfaces/help-article.interface.ts`.
|
|
5
|
-
*/
|
|
6
|
-
declare const HELP_MODES: readonly ["tutorial", "how-to", "reference", "explanation"];
|
|
7
|
-
type HelpMode = (typeof HELP_MODES)[number];
|
|
8
|
-
interface HelpHeading {
|
|
9
|
-
depth: 2 | 3;
|
|
10
|
-
slug: string;
|
|
11
|
-
text: string;
|
|
12
|
-
}
|
|
13
|
-
interface HelpArticle {
|
|
14
|
-
id: string;
|
|
15
|
-
slug: string;
|
|
16
|
-
mode: HelpMode;
|
|
17
|
-
title: string;
|
|
18
|
-
summary: string;
|
|
19
|
-
order: number;
|
|
20
|
-
tags: readonly string[];
|
|
21
|
-
contextualKeys: readonly string[];
|
|
22
|
-
aiIndexed: boolean;
|
|
23
|
-
draft: boolean;
|
|
24
|
-
contentHash: string;
|
|
25
|
-
path: string;
|
|
26
|
-
headings: readonly HelpHeading[];
|
|
27
|
-
relatedSlugs: readonly string[];
|
|
28
|
-
lastUpdated: string;
|
|
29
|
-
}
|
|
30
|
-
interface HelpRedirect {
|
|
31
|
-
from: string;
|
|
32
|
-
to: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
interface HelpBrandConfig {
|
|
36
|
-
/** URL of the brand logo image (served by the consuming app). */
|
|
37
|
-
logo?: string;
|
|
38
|
-
/** Brand label shown in the help header. */
|
|
39
|
-
label?: string;
|
|
40
|
-
/** Where the "Open app" button navigates for logged-in users. Defaults to "/". */
|
|
41
|
-
appHref?: string;
|
|
42
|
-
}
|
|
43
|
-
interface HelpContentConfig {
|
|
44
|
-
manifest: readonly HelpArticle[];
|
|
45
|
-
namespaceUuid: string;
|
|
46
|
-
redirects?: readonly HelpRedirect[];
|
|
47
|
-
brand?: HelpBrandConfig;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export { type HelpContentConfig as H, type HelpArticle as a, type HelpMode as b, type HelpBrandConfig as c, HELP_MODES as d, type HelpHeading as e, type HelpRedirect as f };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Details Template
|
|
3
|
-
*
|
|
4
|
-
* Generates {Module}Details.tsx component for displaying item details.
|
|
5
|
-
*/
|
|
6
|
-
import { FrontendTemplateData } from "../../types/template-data.interface";
|
|
7
|
-
/**
|
|
8
|
-
* Generate the details component file content
|
|
9
|
-
*
|
|
10
|
-
* @param data - Frontend template data
|
|
11
|
-
* @returns Generated file content
|
|
12
|
-
*/
|
|
13
|
-
export declare function generateDetailsTemplate(data: FrontendTemplateData): string;
|
|
14
|
-
//# sourceMappingURL=details.template.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"details.template.d.ts","sourceRoot":"","sources":["../../../../../scripts/generate-web-module/templates/components/details.template.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAmC1E"}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Details Template
|
|
4
|
-
*
|
|
5
|
-
* Generates {Module}Details.tsx component for displaying item details.
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.generateDetailsTemplate = generateDetailsTemplate;
|
|
9
|
-
const name_transformer_1 = require("../../transformers/name-transformer");
|
|
10
|
-
/**
|
|
11
|
-
* Generate the details component file content
|
|
12
|
-
*
|
|
13
|
-
* @param data - Frontend template data
|
|
14
|
-
* @returns Generated file content
|
|
15
|
-
*/
|
|
16
|
-
function generateDetailsTemplate(data) {
|
|
17
|
-
const { names, fields, relationships, extendsContent } = data;
|
|
18
|
-
const attributeElements = generateAttributeElements(data);
|
|
19
|
-
return `"use client";
|
|
20
|
-
|
|
21
|
-
import { use${names.pascalCase}Context } from "@/features/${data.importTargetDir}/${names.kebabCase}/contexts/${names.pascalCase}Context";
|
|
22
|
-
import { AttributeElement, ContentTitle, ReactMarkdownContainer } from "@carlonicora/nextjs-jsonapi/components";
|
|
23
|
-
import { useSharedContext } from "@carlonicora/nextjs-jsonapi/contexts";
|
|
24
|
-
import { Modules } from "@carlonicora/nextjs-jsonapi/core";
|
|
25
|
-
import { useTranslations } from "next-intl";
|
|
26
|
-
|
|
27
|
-
function ${names.pascalCase}DetailsInternal() {
|
|
28
|
-
const { ${names.camelCase}, reload${names.pascalCase} } = use${names.pascalCase}Context();
|
|
29
|
-
const t = useTranslations();
|
|
30
|
-
const { title } = useSharedContext();
|
|
31
|
-
|
|
32
|
-
if (!${names.camelCase}) return null;
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<div className="flex w-full flex-col gap-y-2">
|
|
36
|
-
<ContentTitle type={title.type} element={title.element} functions={title.functions} module={Modules.${names.pascalCase}} />
|
|
37
|
-
${attributeElements}
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export default function ${names.pascalCase}Details() {
|
|
43
|
-
const { ${names.camelCase} } = use${names.pascalCase}Context();
|
|
44
|
-
if (!${names.camelCase}) return null;
|
|
45
|
-
|
|
46
|
-
return <${names.pascalCase}DetailsInternal />;
|
|
47
|
-
}
|
|
48
|
-
`;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Generate attribute elements for display fields
|
|
52
|
-
*/
|
|
53
|
-
function generateAttributeElements(data) {
|
|
54
|
-
const { names, fields, relationships, extendsContent } = data;
|
|
55
|
-
const elements = [];
|
|
56
|
-
// Show abstract if Content-extending
|
|
57
|
-
if (extendsContent) {
|
|
58
|
-
elements.push(` <AttributeElement
|
|
59
|
-
title={t(\`generic.abstract\`)}
|
|
60
|
-
value={<ReactMarkdownContainer size="small" content={${names.camelCase}.abstract} />}
|
|
61
|
-
/>`);
|
|
62
|
-
}
|
|
63
|
-
// Add custom fields (excluding name, tldr, abstract, content which are handled elsewhere)
|
|
64
|
-
const displayableFields = fields.filter((f) => !["name", "tldr", "abstract", "content", "id"].includes(f.name));
|
|
65
|
-
displayableFields.forEach((field) => {
|
|
66
|
-
if (field.type === "string") {
|
|
67
|
-
elements.push(` <AttributeElement
|
|
68
|
-
title={t(\`features.${names.camelCase}.fields.${field.name}.label\`)}
|
|
69
|
-
value={${names.camelCase}.${field.name}}
|
|
70
|
-
/>`);
|
|
71
|
-
}
|
|
72
|
-
else if (field.type === "boolean") {
|
|
73
|
-
elements.push(` <AttributeElement
|
|
74
|
-
title={t(\`features.${names.camelCase}.fields.${field.name}.label\`)}
|
|
75
|
-
value={${names.camelCase}.${field.name} ? t(\`generic.yes\`) : t(\`generic.no\`)}
|
|
76
|
-
/>`);
|
|
77
|
-
}
|
|
78
|
-
else if (field.type === "number") {
|
|
79
|
-
elements.push(` <AttributeElement
|
|
80
|
-
title={t(\`features.${names.camelCase}.fields.${field.name}.label\`)}
|
|
81
|
-
value={${names.camelCase}.${field.name}?.toString()}
|
|
82
|
-
/>`);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
// Add relationship displays (basic - can be enhanced manually)
|
|
86
|
-
relationships
|
|
87
|
-
.filter((rel) => rel.variant !== "Author") // Skip author, usually shown in title
|
|
88
|
-
.forEach((rel) => {
|
|
89
|
-
const displayProp = rel.targetHasName ? "name" : "id";
|
|
90
|
-
if (rel.single) {
|
|
91
|
-
const propName = (0, name_transformer_1.toCamelCase)(rel.alias || rel.variant || rel.name);
|
|
92
|
-
elements.push(` {${names.camelCase}.${propName} && (
|
|
93
|
-
<AttributeElement
|
|
94
|
-
title={t(\`generic.relationships.${propName}.label\`)}
|
|
95
|
-
value={${names.camelCase}.${propName}.${displayProp}}
|
|
96
|
-
/>
|
|
97
|
-
)}`);
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
const effectiveMany = rel.alias || rel.name;
|
|
101
|
-
const propName = (0, name_transformer_1.pluralize)((0, name_transformer_1.toCamelCase)(effectiveMany));
|
|
102
|
-
elements.push(` {${names.camelCase}.${propName} && ${names.camelCase}.${propName}.length > 0 && (
|
|
103
|
-
<AttributeElement
|
|
104
|
-
title={t(\`entities.${(0, name_transformer_1.pluralize)(rel.name.toLowerCase())}\`, { count: 2 })}
|
|
105
|
-
value={${names.camelCase}.${propName}.map((item) => item.${displayProp}).join(", ")}
|
|
106
|
-
/>
|
|
107
|
-
)}`);
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
return elements.join("\n");
|
|
111
|
-
}
|
|
112
|
-
//# sourceMappingURL=details.template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"details.template.js","sourceRoot":"","sources":["../../../../../scripts/generate-web-module/templates/components/details.template.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Details Template
|
|
3
|
-
*
|
|
4
|
-
* Generates {Module}Details.tsx component for displaying item details.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { pluralize, toCamelCase } from "../../transformers/name-transformer";
|
|
8
|
-
import { FrontendTemplateData } from "../../types/template-data.interface";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Generate the details component file content
|
|
12
|
-
*
|
|
13
|
-
* @param data - Frontend template data
|
|
14
|
-
* @returns Generated file content
|
|
15
|
-
*/
|
|
16
|
-
export function generateDetailsTemplate(data: FrontendTemplateData): string {
|
|
17
|
-
const { names, fields, relationships, extendsContent } = data;
|
|
18
|
-
|
|
19
|
-
const attributeElements = generateAttributeElements(data);
|
|
20
|
-
|
|
21
|
-
return `"use client";
|
|
22
|
-
|
|
23
|
-
import { use${names.pascalCase}Context } from "@/features/${data.importTargetDir}/${names.kebabCase}/contexts/${names.pascalCase}Context";
|
|
24
|
-
import { AttributeElement, ContentTitle, ReactMarkdownContainer } from "@carlonicora/nextjs-jsonapi/components";
|
|
25
|
-
import { useSharedContext } from "@carlonicora/nextjs-jsonapi/contexts";
|
|
26
|
-
import { Modules } from "@carlonicora/nextjs-jsonapi/core";
|
|
27
|
-
import { useTranslations } from "next-intl";
|
|
28
|
-
|
|
29
|
-
function ${names.pascalCase}DetailsInternal() {
|
|
30
|
-
const { ${names.camelCase}, reload${names.pascalCase} } = use${names.pascalCase}Context();
|
|
31
|
-
const t = useTranslations();
|
|
32
|
-
const { title } = useSharedContext();
|
|
33
|
-
|
|
34
|
-
if (!${names.camelCase}) return null;
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<div className="flex w-full flex-col gap-y-2">
|
|
38
|
-
<ContentTitle type={title.type} element={title.element} functions={title.functions} module={Modules.${names.pascalCase}} />
|
|
39
|
-
${attributeElements}
|
|
40
|
-
</div>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export default function ${names.pascalCase}Details() {
|
|
45
|
-
const { ${names.camelCase} } = use${names.pascalCase}Context();
|
|
46
|
-
if (!${names.camelCase}) return null;
|
|
47
|
-
|
|
48
|
-
return <${names.pascalCase}DetailsInternal />;
|
|
49
|
-
}
|
|
50
|
-
`;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Generate attribute elements for display fields
|
|
55
|
-
*/
|
|
56
|
-
function generateAttributeElements(data: FrontendTemplateData): string {
|
|
57
|
-
const { names, fields, relationships, extendsContent } = data;
|
|
58
|
-
const elements: string[] = [];
|
|
59
|
-
|
|
60
|
-
// Show abstract if Content-extending
|
|
61
|
-
if (extendsContent) {
|
|
62
|
-
elements.push(` <AttributeElement
|
|
63
|
-
title={t(\`generic.abstract\`)}
|
|
64
|
-
value={<ReactMarkdownContainer size="small" content={${names.camelCase}.abstract} />}
|
|
65
|
-
/>`);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Add custom fields (excluding name, tldr, abstract, content which are handled elsewhere)
|
|
69
|
-
const displayableFields = fields.filter((f) => !["name", "tldr", "abstract", "content", "id"].includes(f.name));
|
|
70
|
-
|
|
71
|
-
displayableFields.forEach((field) => {
|
|
72
|
-
if (field.type === "string") {
|
|
73
|
-
elements.push(` <AttributeElement
|
|
74
|
-
title={t(\`features.${names.camelCase}.fields.${field.name}.label\`)}
|
|
75
|
-
value={${names.camelCase}.${field.name}}
|
|
76
|
-
/>`);
|
|
77
|
-
} else if (field.type === "boolean") {
|
|
78
|
-
elements.push(` <AttributeElement
|
|
79
|
-
title={t(\`features.${names.camelCase}.fields.${field.name}.label\`)}
|
|
80
|
-
value={${names.camelCase}.${field.name} ? t(\`generic.yes\`) : t(\`generic.no\`)}
|
|
81
|
-
/>`);
|
|
82
|
-
} else if (field.type === "number") {
|
|
83
|
-
elements.push(` <AttributeElement
|
|
84
|
-
title={t(\`features.${names.camelCase}.fields.${field.name}.label\`)}
|
|
85
|
-
value={${names.camelCase}.${field.name}?.toString()}
|
|
86
|
-
/>`);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
// Add relationship displays (basic - can be enhanced manually)
|
|
91
|
-
relationships
|
|
92
|
-
.filter((rel) => rel.variant !== "Author") // Skip author, usually shown in title
|
|
93
|
-
.forEach((rel) => {
|
|
94
|
-
const displayProp = rel.targetHasName ? "name" : "id";
|
|
95
|
-
if (rel.single) {
|
|
96
|
-
const propName = toCamelCase(rel.alias || rel.variant || rel.name);
|
|
97
|
-
elements.push(` {${names.camelCase}.${propName} && (
|
|
98
|
-
<AttributeElement
|
|
99
|
-
title={t(\`generic.relationships.${propName}.label\`)}
|
|
100
|
-
value={${names.camelCase}.${propName}.${displayProp}}
|
|
101
|
-
/>
|
|
102
|
-
)}`);
|
|
103
|
-
} else {
|
|
104
|
-
const effectiveMany = rel.alias || rel.name;
|
|
105
|
-
const propName = pluralize(toCamelCase(effectiveMany));
|
|
106
|
-
elements.push(` {${names.camelCase}.${propName} && ${names.camelCase}.${propName}.length > 0 && (
|
|
107
|
-
<AttributeElement
|
|
108
|
-
title={t(\`entities.${pluralize(rel.name.toLowerCase())}\`, { count: 2 })}
|
|
109
|
-
value={${names.camelCase}.${propName}.map((item) => item.${displayProp}).join(", ")}
|
|
110
|
-
/>
|
|
111
|
-
)}`);
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
return elements.join("\n");
|
|
116
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { InfoIcon, AlertTriangleIcon, LightbulbIcon, XCircleIcon, LucideIcon } from "lucide-react";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
|
|
4
|
-
type CalloutType = "info" | "warning" | "tip" | "danger";
|
|
5
|
-
|
|
6
|
-
const STYLES: Record<CalloutType, { icon: LucideIcon; ring: string }> = {
|
|
7
|
-
info: { icon: InfoIcon, ring: "ring-blue-500/30 bg-blue-500/5" },
|
|
8
|
-
warning: { icon: AlertTriangleIcon, ring: "ring-amber-500/30 bg-amber-500/5" },
|
|
9
|
-
tip: { icon: LightbulbIcon, ring: "ring-emerald-500/30 bg-emerald-500/5" },
|
|
10
|
-
danger: { icon: XCircleIcon, ring: "ring-rose-500/30 bg-rose-500/5" },
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export function Callout({ type = "info", children }: { type?: CalloutType; children: ReactNode }) {
|
|
14
|
-
const { icon: Icon, ring } = STYLES[type];
|
|
15
|
-
return (
|
|
16
|
-
<div className={`my-4 flex gap-3 rounded-md ring-1 p-3 ${ring}`}>
|
|
17
|
-
<Icon className="mt-0.5 h-4 w-4 shrink-0" />
|
|
18
|
-
<div className="text-sm leading-relaxed">{children}</div>
|
|
19
|
-
</div>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Modules } from "../../../../core";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
|
|
4
|
-
export function EntityRef({ type, children }: { type: string; children: ReactNode }) {
|
|
5
|
-
let Icon: React.ComponentType<{ className?: string }> | null = null;
|
|
6
|
-
try {
|
|
7
|
-
const m = Modules.findByName(type);
|
|
8
|
-
Icon = m.icon ?? null;
|
|
9
|
-
} catch {
|
|
10
|
-
Icon = null;
|
|
11
|
-
}
|
|
12
|
-
return (
|
|
13
|
-
<span className="bg-muted text-foreground/90 inline-flex items-center gap-1 rounded px-1.5 py-0.5 align-middle text-xs">
|
|
14
|
-
{Icon ? <Icon className="h-3 w-3" /> : null}
|
|
15
|
-
{children}
|
|
16
|
-
</span>
|
|
17
|
-
);
|
|
18
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import Link from "next/link";
|
|
3
|
-
import { useTranslations } from "next-intl";
|
|
4
|
-
import { useHelp } from "../../contexts/HelpContext";
|
|
5
|
-
import { usePageUrlGenerator } from "../../../../client";
|
|
6
|
-
import { articleUrl } from "../../utils/articleUrl";
|
|
7
|
-
|
|
8
|
-
export function Related({ slugs }: { slugs: string[] }) {
|
|
9
|
-
const t = useTranslations();
|
|
10
|
-
const generateUrl = usePageUrlGenerator();
|
|
11
|
-
const { manifest } = useHelp();
|
|
12
|
-
const items = slugs
|
|
13
|
-
.map((s) => manifest.find((a) => `${a.mode}/${a.slug}` === s))
|
|
14
|
-
.filter((a): a is NonNullable<typeof a> => Boolean(a));
|
|
15
|
-
if (items.length === 0) return null;
|
|
16
|
-
return (
|
|
17
|
-
<aside className="my-6">
|
|
18
|
-
<h3 className="text-muted-foreground mb-2 text-xs font-semibold tracking-wider uppercase">
|
|
19
|
-
{t("help.article.related")}
|
|
20
|
-
</h3>
|
|
21
|
-
<ul className="grid gap-2 sm:grid-cols-2">
|
|
22
|
-
{items.map((a) => (
|
|
23
|
-
<li key={a.id}>
|
|
24
|
-
<Link href={articleUrl(generateUrl, a)} className="hover:bg-muted block rounded border p-3">
|
|
25
|
-
<div className="font-medium">{a.title}</div>
|
|
26
|
-
<div className="text-muted-foreground text-xs">{a.summary}</div>
|
|
27
|
-
</Link>
|
|
28
|
-
</li>
|
|
29
|
-
))}
|
|
30
|
-
</ul>
|
|
31
|
-
</aside>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export function Screenshot({ src, alt, caption }: { src: string; alt?: string; caption?: string }) {
|
|
2
|
-
const url = src.startsWith("/") ? src : `/help-assets/${src}`;
|
|
3
|
-
return (
|
|
4
|
-
<figure className="my-4">
|
|
5
|
-
<img src={url} alt={alt ?? caption ?? ""} className="rounded-md ring-1 ring-border" />
|
|
6
|
-
{caption ? <figcaption className="text-muted-foreground mt-1 text-xs">{caption}</figcaption> : null}
|
|
7
|
-
</figure>
|
|
8
|
-
);
|
|
9
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ReactNode, Children } from "react";
|
|
2
|
-
|
|
3
|
-
export function Steps({ children }: { children: ReactNode }) {
|
|
4
|
-
const items = Children.toArray(children);
|
|
5
|
-
return (
|
|
6
|
-
<ol className="my-4 list-none space-y-3 pl-0">
|
|
7
|
-
{items.map((child, i) => (
|
|
8
|
-
<li key={i} className="flex gap-3">
|
|
9
|
-
<span className="bg-muted text-muted-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs">
|
|
10
|
-
{i + 1}
|
|
11
|
-
</span>
|
|
12
|
-
<div className="flex-1 [&>p:first-child]:mt-0">{child}</div>
|
|
13
|
-
</li>
|
|
14
|
-
))}
|
|
15
|
-
</ol>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function Step({ children }: { children: ReactNode }) {
|
|
20
|
-
return <>{children}</>;
|
|
21
|
-
}
|