@contember/react-client 0.7.0-alpha.20
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/LICENSE +186 -0
- package/dist/development/ClientError.js +5 -0
- package/dist/development/ClientError.js.map +1 -0
- package/dist/development/ContemberClient.js +30 -0
- package/dist/development/ContemberClient.js.map +1 -0
- package/dist/development/apiRequest/apiRequestReducer.js +33 -0
- package/dist/development/apiRequest/apiRequestReducer.js.map +1 -0
- package/dist/development/apiRequest/useApiRequest.js +43 -0
- package/dist/development/apiRequest/useApiRequest.js.map +1 -0
- package/dist/development/auth/SessionTokenContext.js +6 -0
- package/dist/development/auth/SessionTokenContext.js.map +1 -0
- package/dist/development/auth/useLoginRequest.js +18 -0
- package/dist/development/auth/useLoginRequest.js.map +1 -0
- package/dist/development/auth/useSessionToken.js +7 -0
- package/dist/development/auth/useSessionToken.js.map +1 -0
- package/dist/development/components/RichTextRenderer/ElementRenderer.js +25 -0
- package/dist/development/components/RichTextRenderer/ElementRenderer.js.map +1 -0
- package/dist/development/components/RichTextRenderer/LeafRenderer.js +21 -0
- package/dist/development/components/RichTextRenderer/LeafRenderer.js.map +1 -0
- package/dist/development/components/RichTextRenderer/RenderElementFallback.js +107 -0
- package/dist/development/components/RichTextRenderer/RenderElementFallback.js.map +1 -0
- package/dist/development/components/RichTextRenderer/RenderLeafFallback.js +36 -0
- package/dist/development/components/RichTextRenderer/RenderLeafFallback.js.map +1 -0
- package/dist/development/components/RichTextRenderer/RichTextRenderMetadataContext.js +14 -0
- package/dist/development/components/RichTextRenderer/RichTextRenderMetadataContext.js.map +1 -0
- package/dist/development/components/RichTextRenderer/RichTextRenderer.js +91 -0
- package/dist/development/components/RichTextRenderer/RichTextRenderer.js.map +1 -0
- package/dist/development/components/RichTextRenderer/RichTextRendererError.js +5 -0
- package/dist/development/components/RichTextRenderer/RichTextRendererError.js.map +1 -0
- package/dist/development/components/RichTextRenderer/defaultDeserialize.js +13 -0
- package/dist/development/components/RichTextRenderer/defaultDeserialize.js.map +1 -0
- package/dist/development/components/RichTextRenderer/renderChildren.js +29 -0
- package/dist/development/components/RichTextRenderer/renderChildren.js.map +1 -0
- package/dist/development/components/RichTextRenderer/resolveRichTextElementMetadata.js +27 -0
- package/dist/development/components/RichTextRenderer/resolveRichTextElementMetadata.js.map +1 -0
- package/dist/development/config/ApiBaseUrlContext.js +6 -0
- package/dist/development/config/ApiBaseUrlContext.js.map +1 -0
- package/dist/development/config/LoginTokenContext.js +6 -0
- package/dist/development/config/LoginTokenContext.js.map +1 -0
- package/dist/development/config/useApiBaseUrl.js +7 -0
- package/dist/development/config/useApiBaseUrl.js.map +1 -0
- package/dist/development/config/useLoginToken.js +7 -0
- package/dist/development/config/useLoginToken.js.map +1 -0
- package/dist/development/content/useContentApiRequest.js +7 -0
- package/dist/development/content/useContentApiRequest.js.map +1 -0
- package/dist/development/content/useContentGraphQlClient.js +7 -0
- package/dist/development/content/useContentGraphQlClient.js.map +1 -0
- package/dist/development/content/useCurrentContentGraphQlClient.js +19 -0
- package/dist/development/content/useCurrentContentGraphQlClient.js.map +1 -0
- package/dist/development/index.js +31 -0
- package/dist/development/index.js.map +1 -0
- package/dist/development/project/ProjectSlugContext.js +6 -0
- package/dist/development/project/ProjectSlugContext.js.map +1 -0
- package/dist/development/project/StageSlugContext.js +6 -0
- package/dist/development/project/StageSlugContext.js.map +1 -0
- package/dist/development/project/useProjectSlug.js +7 -0
- package/dist/development/project/useProjectSlug.js.map +1 -0
- package/dist/development/project/useStageSlug.js +7 -0
- package/dist/development/project/useStageSlug.js.map +1 -0
- package/dist/development/system/useCurrentSystemGraphQlClient.js +14 -0
- package/dist/development/system/useCurrentSystemGraphQlClient.js.map +1 -0
- package/dist/development/system/useDiffQuery.js +17 -0
- package/dist/development/system/useDiffQuery.js.map +1 -0
- package/dist/development/system/useReleaseTreeMutation.js +17 -0
- package/dist/development/system/useReleaseTreeMutation.js.map +1 -0
- package/dist/development/system/useSystemApiRequest.js +7 -0
- package/dist/development/system/useSystemApiRequest.js.map +1 -0
- package/dist/development/system/useSystemGraphQlClient.js +7 -0
- package/dist/development/system/useSystemGraphQlClient.js.map +1 -0
- package/dist/development/tenant/useTenantApiRequest.js +7 -0
- package/dist/development/tenant/useTenantApiRequest.js.map +1 -0
- package/dist/development/tenant/useTenantGraphQlClient.js +7 -0
- package/dist/development/tenant/useTenantGraphQlClient.js.map +1 -0
- package/dist/development/upload/fileUploadReducer.js +162 -0
- package/dist/development/upload/fileUploadReducer.js.map +1 -0
- package/dist/development/upload/toFileId.js +9 -0
- package/dist/development/upload/toFileId.js.map +1 -0
- package/dist/development/upload/useFileUpload.js +192 -0
- package/dist/development/upload/useFileUpload.js.map +1 -0
- package/dist/development/useGraphQlClient.js +13 -0
- package/dist/development/useGraphQlClient.js.map +1 -0
- package/dist/development/utils/assertNever.js +6 -0
- package/dist/development/utils/assertNever.js.map +1 -0
- package/dist/production/ClientError.js +4 -0
- package/dist/production/ClientError.js.map +1 -0
- package/dist/production/ContemberClient.js +28 -0
- package/dist/production/ContemberClient.js.map +1 -0
- package/dist/production/apiRequest/apiRequestReducer.js +32 -0
- package/dist/production/apiRequest/apiRequestReducer.js.map +1 -0
- package/dist/production/apiRequest/useApiRequest.js +41 -0
- package/dist/production/apiRequest/useApiRequest.js.map +1 -0
- package/dist/production/auth/SessionTokenContext.js +4 -0
- package/dist/production/auth/SessionTokenContext.js.map +1 -0
- package/dist/production/auth/useLoginRequest.js +16 -0
- package/dist/production/auth/useLoginRequest.js.map +1 -0
- package/dist/production/auth/useSessionToken.js +5 -0
- package/dist/production/auth/useSessionToken.js.map +1 -0
- package/dist/production/components/RichTextRenderer/ElementRenderer.js +23 -0
- package/dist/production/components/RichTextRenderer/ElementRenderer.js.map +1 -0
- package/dist/production/components/RichTextRenderer/LeafRenderer.js +19 -0
- package/dist/production/components/RichTextRenderer/LeafRenderer.js.map +1 -0
- package/dist/production/components/RichTextRenderer/RenderElementFallback.js +104 -0
- package/dist/production/components/RichTextRenderer/RenderElementFallback.js.map +1 -0
- package/dist/production/components/RichTextRenderer/RenderLeafFallback.js +34 -0
- package/dist/production/components/RichTextRenderer/RenderLeafFallback.js.map +1 -0
- package/dist/production/components/RichTextRenderer/RichTextRenderMetadataContext.js +12 -0
- package/dist/production/components/RichTextRenderer/RichTextRenderMetadataContext.js.map +1 -0
- package/dist/production/components/RichTextRenderer/RichTextRenderer.js +89 -0
- package/dist/production/components/RichTextRenderer/RichTextRenderer.js.map +1 -0
- package/dist/production/components/RichTextRenderer/RichTextRendererError.js +4 -0
- package/dist/production/components/RichTextRenderer/RichTextRendererError.js.map +1 -0
- package/dist/production/components/RichTextRenderer/defaultDeserialize.js +12 -0
- package/dist/production/components/RichTextRenderer/defaultDeserialize.js.map +1 -0
- package/dist/production/components/RichTextRenderer/renderChildren.js +27 -0
- package/dist/production/components/RichTextRenderer/renderChildren.js.map +1 -0
- package/dist/production/components/RichTextRenderer/resolveRichTextElementMetadata.js +25 -0
- package/dist/production/components/RichTextRenderer/resolveRichTextElementMetadata.js.map +1 -0
- package/dist/production/config/ApiBaseUrlContext.js +4 -0
- package/dist/production/config/ApiBaseUrlContext.js.map +1 -0
- package/dist/production/config/LoginTokenContext.js +4 -0
- package/dist/production/config/LoginTokenContext.js.map +1 -0
- package/dist/production/config/useApiBaseUrl.js +5 -0
- package/dist/production/config/useApiBaseUrl.js.map +1 -0
- package/dist/production/config/useLoginToken.js +5 -0
- package/dist/production/config/useLoginToken.js.map +1 -0
- package/dist/production/content/useContentApiRequest.js +5 -0
- package/dist/production/content/useContentApiRequest.js.map +1 -0
- package/dist/production/content/useContentGraphQlClient.js +5 -0
- package/dist/production/content/useContentGraphQlClient.js.map +1 -0
- package/dist/production/content/useCurrentContentGraphQlClient.js +17 -0
- package/dist/production/content/useCurrentContentGraphQlClient.js.map +1 -0
- package/dist/production/index.js +31 -0
- package/dist/production/index.js.map +1 -0
- package/dist/production/project/ProjectSlugContext.js +4 -0
- package/dist/production/project/ProjectSlugContext.js.map +1 -0
- package/dist/production/project/StageSlugContext.js +4 -0
- package/dist/production/project/StageSlugContext.js.map +1 -0
- package/dist/production/project/useProjectSlug.js +5 -0
- package/dist/production/project/useProjectSlug.js.map +1 -0
- package/dist/production/project/useStageSlug.js +5 -0
- package/dist/production/project/useStageSlug.js.map +1 -0
- package/dist/production/system/useCurrentSystemGraphQlClient.js +12 -0
- package/dist/production/system/useCurrentSystemGraphQlClient.js.map +1 -0
- package/dist/production/system/useDiffQuery.js +15 -0
- package/dist/production/system/useDiffQuery.js.map +1 -0
- package/dist/production/system/useReleaseTreeMutation.js +15 -0
- package/dist/production/system/useReleaseTreeMutation.js.map +1 -0
- package/dist/production/system/useSystemApiRequest.js +5 -0
- package/dist/production/system/useSystemApiRequest.js.map +1 -0
- package/dist/production/system/useSystemGraphQlClient.js +5 -0
- package/dist/production/system/useSystemGraphQlClient.js.map +1 -0
- package/dist/production/tenant/useTenantApiRequest.js +5 -0
- package/dist/production/tenant/useTenantApiRequest.js.map +1 -0
- package/dist/production/tenant/useTenantGraphQlClient.js +5 -0
- package/dist/production/tenant/useTenantGraphQlClient.js.map +1 -0
- package/dist/production/upload/fileUploadReducer.js +160 -0
- package/dist/production/upload/fileUploadReducer.js.map +1 -0
- package/dist/production/upload/toFileId.js +8 -0
- package/dist/production/upload/toFileId.js.map +1 -0
- package/dist/production/upload/useFileUpload.js +190 -0
- package/dist/production/upload/useFileUpload.js.map +1 -0
- package/dist/production/useGraphQlClient.js +11 -0
- package/dist/production/useGraphQlClient.js.map +1 -0
- package/dist/production/utils/assertNever.js +5 -0
- package/dist/production/utils/assertNever.js.map +1 -0
- package/dist/react-client.d.ts +370 -0
- package/package.json +31 -0
- package/readme.md +22 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderElementFallback.js","sources":["../../../../src/components/RichTextRenderer/RenderElementFallback.tsx"],"sourcesContent":["import { createElement, ReactElement } from 'react'\nimport type { BuiltinElements, RichTextReferenceElement, RichTextTableRowElement } from './BuiltinElements'\nimport { renderChildren, RenderChildrenOptions } from './renderChildren'\nimport { resolveRichTextElementMetadata } from './resolveRichTextElementMetadata'\nimport type { RichTextElement } from './RichTextElement'\nimport type { RichTextLeaf } from './RichTextLeaf'\nimport { RichTextRendererError } from './RichTextRendererError'\nimport { useRichTextRenderMetadata } from './RichTextRenderMetadataContext'\n\nexport interface RenderElementFallbackProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n> {\n\telement: BuiltinElements<CustomElements, CustomLeaves>\n\tchildren: ReactElement\n\toptions: RenderChildrenOptions<CustomElements, CustomLeaves>\n}\n\nconst getElementDataAttributes = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n>(\n\telement: RichTextElement<CustomElements, CustomLeaves>,\n\tattributeNamePrefix: string = 'contember-',\n): {\n\t[dataAttribute: string]: string | number | boolean\n} => {\n\tconst { children, referenceId, ...extendedSpecifics } = element\n\n\treturn Object.fromEntries(\n\t\tObject.entries(extendedSpecifics)\n\t\t\t.filter(([, value]) => {\n\t\t\t\tconst t = typeof value\n\t\t\t\treturn t === 'string' || t === 'number' || t === 'boolean'\n\t\t\t})\n\t\t\t.map(([attribute, value]) => [`data-${attributeNamePrefix}${attribute.toLowerCase()}`, value]),\n\t)\n}\n\nexport function RenderElementFallback<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n>({ element, children, options }: RenderElementFallbackProps<CustomElements, CustomLeaves>) {\n\tconst attributes = getElementDataAttributes(element, options.attributeNamePrefix)\n\n\tswitch (element.type) {\n\t\tcase 'anchor':\n\t\t\treturn (\n\t\t\t\t<a {...attributes} href={element.href}>\n\t\t\t\t\t{children}\n\t\t\t\t</a>\n\t\t\t)\n\t\tcase 'heading':\n\t\t\treturn createElement(`h${element.level}`, attributes, children) // TODO numbered\n\t\tcase 'horizontalRule':\n\t\t\treturn <hr {...attributes} />\n\t\tcase 'listItem':\n\t\t\treturn <li {...attributes}>{children}</li>\n\t\tcase 'orderedList':\n\t\t\treturn <ol {...attributes}>{children}</ol>\n\t\tcase 'paragraph':\n\t\t\treturn <p {...attributes}>{children}</p>\n\t\tcase 'reference': {\n\t\t\treturn <ReferenceElementFallback element={element} children={children} />\n\t\t}\n\t\tcase 'scrollTarget':\n\t\t\treturn (\n\t\t\t\t<span {...attributes} id={element.identifier}>\n\t\t\t\t\t{children}\n\t\t\t\t</span>\n\t\t\t)\n\t\tcase 'table': {\n\t\t\tconst firstRow = element.children[0] as RichTextTableRowElement<CustomElements, CustomLeaves> | undefined\n\t\t\tif (!firstRow || firstRow.headerScope !== 'table') {\n\t\t\t\treturn (\n\t\t\t\t\t<table {...attributes}>\n\t\t\t\t\t\t<tbody>{children}</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<table {...attributes}>\n\t\t\t\t\t<thead>{renderChildren<CustomElements, CustomLeaves>([firstRow], options)}</thead>\n\t\t\t\t\t<tbody>{renderChildren<CustomElements, CustomLeaves>(element.children.slice(1) as any, options)}</tbody>\n\t\t\t\t</table>\n\t\t\t)\n\t\t}\n\t\tcase 'tableRow':\n\t\t\treturn <tr {...attributes}>{children}</tr>\n\t\tcase 'tableCell': {\n\t\t\tif (element.headerScope) {\n\t\t\t\treturn (\n\t\t\t\t\t<th {...attributes} scope={element.headerScope}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</th>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn <td {...attributes}>{children}</td>\n\t\t}\n\t\tcase 'unorderedList':\n\t\t\treturn <ul {...attributes}>{children}</ul>\n\t\tdefault: {\n\t\t\tif (import.meta.env.DEV) {\n\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t`RichTextRenderer: unknown element of type '${(element as { type: string }).type}'.`,\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\treturn children // At least render the text contents\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction ReferenceElementFallback<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n>({ element, children }: { element: RichTextReferenceElement<CustomElements, CustomLeaves>; children: ReactElement }) {\n\tconst metadata = useRichTextRenderMetadata<CustomElements, CustomLeaves>()\n\tconst elementMetadata = resolveRichTextElementMetadata<CustomElements, CustomLeaves>(element, metadata)\n\n\tif (\n\t\telementMetadata.referenceRenderer === undefined ||\n\t\telementMetadata.referenceType === undefined ||\n\t\telementMetadata.reference === undefined\n\t) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tthrow new RichTextRendererError(\n\t\t\t\t`RichTextRenderer: cannot render reference of type '${elementMetadata.referenceType}'.`,\n\t\t\t)\n\t\t} else {\n\t\t\treturn children // At least render the text contents\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{elementMetadata.referenceRenderer?.({\n\t\t\t\treferenceType: elementMetadata.referenceType,\n\t\t\t\treferenceRenderer: elementMetadata.referenceRenderer,\n\t\t\t\treference: elementMetadata.reference,\n\t\t\t\tformatVersion: elementMetadata.formatVersion,\n\t\t\t\telement,\n\t\t\t\tchildren,\n\t\t\t})}\n\t\t</>\n\t)\n}\n"],"names":[],"mappings":";;;;;;AAkBA,MAAM,2BAA2B,CAIhC,SACA,sBAA8B,iBAG1B;AACJ,QAAM,EAAE,UAAU,gBAAgB,sBAAsB;AAExD,SAAO,OAAO,YACb,OAAO,QAAQ,mBACb,OAAO,CAAC,GAAG,WAAW;AACtB,UAAM,IAAI,OAAO;AACjB,WAAO,MAAM,YAAY,MAAM,YAAY,MAAM;AAAA,KAEjD,IAAI,CAAC,CAAC,WAAW,WAAW,CAAC,QAAQ,sBAAsB,UAAU,iBAAiB;AAAA;+BAOxF,EAAE,SAAS,UAAU,WAAqE;AAC3F,QAAM,aAAa,yBAAyB,SAAS,QAAQ;AAE7D,UAAQ,QAAQ;AAAA,SACV;AACJ,2CACE,KAAD;AAAA,WAAO;AAAA,QAAY,MAAM,QAAQ;AAAA,SAC/B;AAAA,SAGC;AACJ,aAAO,cAAc,IAAI,QAAQ,SAAS,YAAY;AAAA,SAClD;AACJ,2CAAQ,MAAD;AAAA,WAAQ;AAAA;AAAA,SACX;AACJ,2CAAQ,MAAD;AAAA,WAAQ;AAAA,SAAa;AAAA,SACxB;AACJ,2CAAQ,MAAD;AAAA,WAAQ;AAAA,SAAa;AAAA,SACxB;AACJ,2CAAQ,KAAD;AAAA,WAAO;AAAA,SAAa;AAAA,SACvB,aAAa;AACjB,2CAAQ,0BAAD;AAAA,QAA0B;AAAA,QAAkB;AAAA;AAAA;AAAA,SAE/C;AACJ,2CACE,QAAD;AAAA,WAAU;AAAA,QAAY,IAAI,QAAQ;AAAA,SAChC;AAAA,SAGC,SAAS;AACb,YAAM,WAAW,QAAQ,SAAS;AAClC,UAAI,CAAC,YAAY,SAAS,gBAAgB,SAAS;AAClD,6CACE,SAAD;AAAA,aAAW;AAAA,yCACT,SAAD,MAAQ;AAAA;AAIX,2CACE,SAAD;AAAA,WAAW;AAAA,uCACT,SAAD,MAAQ,eAA6C,CAAC,WAAW,yCAChE,SAAD,MAAQ,eAA6C,QAAQ,SAAS,MAAM,IAAW;AAAA;AAAA,SAIrF;AACJ,2CAAQ,MAAD;AAAA,WAAQ;AAAA,SAAa;AAAA,SACxB,aAAa;AACjB,UAAI,QAAQ,aAAa;AACxB,6CACE,MAAD;AAAA,aAAQ;AAAA,UAAY,OAAO,QAAQ;AAAA,WACjC;AAAA;AAIJ,2CAAQ,MAAD;AAAA,WAAQ;AAAA,SAAa;AAAA;AAAA,SAExB;AACJ,2CAAQ,MAAD;AAAA,WAAQ;AAAA,SAAa;AAAA,aACpB;AACR,MAAyB;AACxB,cAAM,IAAI,sBACT,8CAA+C,QAA6B;AAAA;AAGtE;AAAA;AAAA;AAMX,kCAGE,EAAE,SAAS,YAAyG;AACrH,QAAM,WAAW;AACjB,QAAM,kBAAkB,+BAA6D,SAAS;AAE9F,MACC,gBAAgB,sBAAsB,UACtC,gBAAgB,kBAAkB,UAClC,gBAAgB,cAAc,QAC7B;AACD,IAAyB;AACxB,YAAM,IAAI,sBACT,sDAAsD,gBAAgB;AAAA;AAGhE;AAIT,uDAEG,gBAAgB,oBAAoB;AAAA,IACpC,eAAe,gBAAgB;AAAA,IAC/B,mBAAmB,gBAAgB;AAAA,IACnC,WAAW,gBAAgB;AAAA,IAC3B,eAAe,gBAAgB;AAAA,IAC/B;AAAA,IACA;AAAA;AAAA;;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createElement, Fragment } from 'react';
|
|
2
|
+
|
|
3
|
+
function jsxN2br(text) {
|
|
4
|
+
const lines = text.split("\n");
|
|
5
|
+
if (lines.length <= 1) {
|
|
6
|
+
return text;
|
|
7
|
+
}
|
|
8
|
+
return lines.map((line, i) => /* @__PURE__ */ createElement(Fragment, {
|
|
9
|
+
key: i
|
|
10
|
+
}, !!i && /* @__PURE__ */ createElement("br", null), line));
|
|
11
|
+
}
|
|
12
|
+
function RenderLeafFallback({ leaf }) {
|
|
13
|
+
let element = jsxN2br(leaf.text);
|
|
14
|
+
if ("isCode" in leaf && leaf.isCode === true) {
|
|
15
|
+
element = /* @__PURE__ */ createElement("code", null, element);
|
|
16
|
+
}
|
|
17
|
+
if ("isStruckThrough" in leaf && leaf.isStruckThrough === true) {
|
|
18
|
+
element = /* @__PURE__ */ createElement("s", null, element);
|
|
19
|
+
}
|
|
20
|
+
if ("isHighlighted" in leaf && leaf.isHighlighted === true) {
|
|
21
|
+
element = /* @__PURE__ */ createElement("em", null, element);
|
|
22
|
+
}
|
|
23
|
+
if ("isUnderlined" in leaf && leaf.isUnderlined === true) {
|
|
24
|
+
element = /* @__PURE__ */ createElement("u", null, element);
|
|
25
|
+
}
|
|
26
|
+
if ("isItalic" in leaf && leaf.isItalic === true) {
|
|
27
|
+
element = /* @__PURE__ */ createElement("i", null, element);
|
|
28
|
+
}
|
|
29
|
+
if ("isBold" in leaf && leaf.isBold === true) {
|
|
30
|
+
element = /* @__PURE__ */ createElement("b", null, element);
|
|
31
|
+
}
|
|
32
|
+
return /* @__PURE__ */ createElement(Fragment, null, element);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { RenderLeafFallback };
|
|
36
|
+
//# sourceMappingURL=RenderLeafFallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderLeafFallback.js","sources":["../../../../src/components/RichTextRenderer/RenderLeafFallback.tsx"],"sourcesContent":["import { Fragment, ReactNode } from 'react'\nimport type { BuiltinLeaves } from './BuiltinLeaves'\n\nexport interface RenderLeafFallbackProps {\n\tleaf: BuiltinLeaves\n}\n\nfunction jsxN2br(text: string): ReactNode {\n\tconst lines = text.split('\\n')\n\tif (lines.length <= 1) {\n\t\treturn text\n\t}\n\treturn lines.map((line, i) => (\n\t\t<Fragment key={i}>\n\t\t\t{!!i && <br />}\n\t\t\t{line}\n\t\t</Fragment>\n\t))\n}\n\nexport function RenderLeafFallback({ leaf }: RenderLeafFallbackProps) {\n\tlet element = jsxN2br(leaf.text)\n\n\tif ('isCode' in leaf && leaf.isCode === true) {\n\t\telement = <code>{element}</code>\n\t}\n\tif ('isStruckThrough' in leaf && leaf.isStruckThrough === true) {\n\t\telement = <s>{element}</s>\n\t}\n\tif ('isHighlighted' in leaf && leaf.isHighlighted === true) {\n\t\telement = <em>{element}</em>\n\t}\n\tif ('isUnderlined' in leaf && leaf.isUnderlined === true) {\n\t\telement = <u>{element}</u>\n\t}\n\tif ('isItalic' in leaf && leaf.isItalic === true) {\n\t\telement = <i>{element}</i>\n\t}\n\tif ('isBold' in leaf && leaf.isBold === true) {\n\t\telement = <b>{element}</b>\n\t}\n\treturn <>{element}</>\n}\n"],"names":[],"mappings":";;AAOA,iBAAiB,MAAyB;AACzC,QAAM,QAAQ,KAAK,MAAM;AACzB,MAAI,MAAM,UAAU,GAAG;AACtB,WAAO;AAAA;AAER,SAAO,MAAM,IAAI,CAAC,MAAM,oCACtB,UAAD;AAAA,IAAU,KAAK;AAAA,KACb,CAAC,CAAC,mCAAM,MAAD,OACP;AAAA;4BAK+B,EAAE,QAAiC;AACrE,MAAI,UAAU,QAAQ,KAAK;AAE3B,MAAI,YAAY,QAAQ,KAAK,WAAW,MAAM;AAC7C,4CAAW,QAAD,MAAO;AAAA;AAElB,MAAI,qBAAqB,QAAQ,KAAK,oBAAoB,MAAM;AAC/D,4CAAW,KAAD,MAAI;AAAA;AAEf,MAAI,mBAAmB,QAAQ,KAAK,kBAAkB,MAAM;AAC3D,4CAAW,MAAD,MAAK;AAAA;AAEhB,MAAI,kBAAkB,QAAQ,KAAK,iBAAiB,MAAM;AACzD,4CAAW,KAAD,MAAI;AAAA;AAEf,MAAI,cAAc,QAAQ,KAAK,aAAa,MAAM;AACjD,4CAAW,KAAD,MAAI;AAAA;AAEf,MAAI,YAAY,QAAQ,KAAK,WAAW,MAAM;AAC7C,4CAAW,KAAD,MAAI;AAAA;AAEf,uDAAU;AAAA;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
const RichTextRenderMetadataContext = createContext({
|
|
4
|
+
formatVersion: 0,
|
|
5
|
+
referencesField: void 0,
|
|
6
|
+
referenceDiscriminationField: void 0,
|
|
7
|
+
referenceRenderers: {},
|
|
8
|
+
references: void 0
|
|
9
|
+
});
|
|
10
|
+
RichTextRenderMetadataContext.displayName = "RichTextRenderMetadataContext";
|
|
11
|
+
const useRichTextRenderMetadata = () => useContext(RichTextRenderMetadataContext);
|
|
12
|
+
|
|
13
|
+
export { RichTextRenderMetadataContext, useRichTextRenderMetadata };
|
|
14
|
+
//# sourceMappingURL=RichTextRenderMetadataContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichTextRenderMetadataContext.js","sources":["../../../../src/components/RichTextRenderer/RichTextRenderMetadataContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { RichTextElement } from './RichTextElement'\nimport type { RichTextLeaf } from './RichTextLeaf'\nimport type { RichTextReference } from './RichTextReference'\nimport type { RichTextRenderMetadata } from './RichTextRenderMetadata'\n\nexport const RichTextRenderMetadataContext = createContext<RichTextRenderMetadata<any, any, any>>({\n\tformatVersion: 0,\n\treferencesField: undefined,\n\treferenceDiscriminationField: undefined,\n\treferenceRenderers: {},\n\treferences: undefined,\n})\nRichTextRenderMetadataContext.displayName = 'RichTextRenderMetadataContext'\n\nexport const useRichTextRenderMetadata = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n\tReference extends RichTextReference = RichTextReference,\n>() => useContext(RichTextRenderMetadataContext) as RichTextRenderMetadata<CustomElements, CustomLeaves, Reference>\n"],"names":[],"mappings":";;MAMa,gCAAgC,cAAqD;AAAA,EACjG,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,8BAA8B;AAAA,EAC9B,oBAAoB;AAAA,EACpB,YAAY;AAAA;AAEb,8BAA8B,cAAc;MAE/B,4BAA4B,MAIlC,WAAW;;;;"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { memo, useMemo, createElement, Fragment } from 'react';
|
|
2
|
+
import { defaultDeserialize } from './defaultDeserialize.js';
|
|
3
|
+
import { renderChildren } from './renderChildren.js';
|
|
4
|
+
import { RichTextRendererError } from './RichTextRendererError.js';
|
|
5
|
+
import { RichTextRenderMetadataContext } from './RichTextRenderMetadataContext.js';
|
|
6
|
+
|
|
7
|
+
const RichTextRenderer = memo(function RichTextRenderer2({
|
|
8
|
+
deserialize = defaultDeserialize,
|
|
9
|
+
renderElement,
|
|
10
|
+
renderLeaf,
|
|
11
|
+
attributeNamePrefix,
|
|
12
|
+
...sourceProps
|
|
13
|
+
}) {
|
|
14
|
+
const normalizedSource = useMemo(() => {
|
|
15
|
+
if ("source" in sourceProps && !("blocks" in sourceProps)) {
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
content: sourceProps.source ? deserialize(sourceProps.source) : {
|
|
19
|
+
formatVersion: 0,
|
|
20
|
+
children: []
|
|
21
|
+
},
|
|
22
|
+
id: void 0,
|
|
23
|
+
referencesField: void 0,
|
|
24
|
+
referenceDiscriminationField: void 0,
|
|
25
|
+
referenceRenderers: {},
|
|
26
|
+
references: void 0
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
if ("blocks" in sourceProps) {
|
|
31
|
+
const sourceField = sourceProps.sourceField ?? "source";
|
|
32
|
+
const referencesField = sourceProps.referencesField ?? "references";
|
|
33
|
+
const referenceDiscriminationField = sourceProps.referenceDiscriminationField ?? "type";
|
|
34
|
+
return sourceProps.blocks.map((block) => {
|
|
35
|
+
if (!(sourceField in block)) {
|
|
36
|
+
throw new RichTextRendererError(`Found a block without a '${sourceField}' field. ` + (sourceProps.sourceField === void 0 ? `The 'sourceField' prop has not been supplied, and so '${sourceField}' was used as a default.` : `That is what the 'sourceField' prop has been set to, and so either this is a typo, or the data supplied is invalid.`));
|
|
37
|
+
}
|
|
38
|
+
const source = block[sourceField];
|
|
39
|
+
if (typeof source !== "string") {
|
|
40
|
+
throw new RichTextRendererError(`Found a block whose source is not a string.`);
|
|
41
|
+
}
|
|
42
|
+
if (sourceProps.referencesField !== void 0 && !(referencesField in block)) {
|
|
43
|
+
throw new RichTextRendererError(`The 'referencesField' prop is set to '${referencesField}' but a block without such field has been encountered. Unless this is just a typo, if you do not wish to use references, avoid supplying the 'referencesField' prop.`);
|
|
44
|
+
}
|
|
45
|
+
const references = block[referencesField];
|
|
46
|
+
let normalizedReferences = void 0;
|
|
47
|
+
if (references) {
|
|
48
|
+
if (typeof Object(references)[Symbol.iterator] !== "function") {
|
|
49
|
+
throw new RichTextRendererError(`The set of references must be an iterable!`);
|
|
50
|
+
}
|
|
51
|
+
normalizedReferences = new Map();
|
|
52
|
+
for (const reference of references) {
|
|
53
|
+
if (!("id" in reference)) {
|
|
54
|
+
throw new RichTextRendererError(`Found a reference without an id field.`);
|
|
55
|
+
}
|
|
56
|
+
if (!(referenceDiscriminationField in reference)) {
|
|
57
|
+
throw new RichTextRendererError(`Found a reference without a '${referenceDiscriminationField}' field. ` + (sourceProps.referenceDiscriminationField === void 0 ? `The 'referenceDiscriminationField' prop has not been supplied, and so '${referenceDiscriminationField}' was used as a default.` : `That is what the 'referenceDiscriminationField' prop has been set to, and so either this is a typo, or the data supplied is invalid.`));
|
|
58
|
+
}
|
|
59
|
+
normalizedReferences.set(reference.id, reference);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
id: typeof block.id === "string" ? block.id : void 0,
|
|
64
|
+
content: deserialize(source),
|
|
65
|
+
referenceDiscriminationField,
|
|
66
|
+
referenceRenderers: sourceProps.referenceRenderers ?? {},
|
|
67
|
+
referencesField,
|
|
68
|
+
references: normalizedReferences
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
throw new RichTextRendererError(`RichTextRenderer: invalid data supplied.`);
|
|
73
|
+
}, [deserialize, sourceProps]);
|
|
74
|
+
return /* @__PURE__ */ createElement(Fragment, null, normalizedSource.map((block, i) => /* @__PURE__ */ createElement(RichTextRenderMetadataContext.Provider, {
|
|
75
|
+
key: block.id ?? i,
|
|
76
|
+
value: {
|
|
77
|
+
formatVersion: block.content.formatVersion,
|
|
78
|
+
referenceRenderers: block.referenceRenderers,
|
|
79
|
+
referencesField: block.referencesField,
|
|
80
|
+
referenceDiscriminationField: block.referenceDiscriminationField,
|
|
81
|
+
references: block.references
|
|
82
|
+
}
|
|
83
|
+
}, renderChildren(block.content.children, {
|
|
84
|
+
renderLeaf,
|
|
85
|
+
renderElement,
|
|
86
|
+
attributeNamePrefix
|
|
87
|
+
}))));
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
export { RichTextRenderer };
|
|
91
|
+
//# sourceMappingURL=RichTextRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichTextRenderer.js","sources":["../../../../src/components/RichTextRenderer/RichTextRenderer.tsx"],"sourcesContent":["import { memo, ReactElement, useMemo } from 'react'\nimport { defaultDeserialize } from './defaultDeserialize'\nimport type { RenderElement } from './ElementRenderer'\nimport type { RenderLeaf } from './LeafRenderer'\nimport type { NormalizedRichTextBlock } from './NormalizedRichTextBlock'\nimport type { ReferenceRenderer } from './ReferenceRenderer'\nimport { renderChildren } from './renderChildren'\nimport type { RichTextBlock } from './RichTextBlock'\nimport type { RichTextElement } from './RichTextElement'\nimport type { RichTextLeaf } from './RichTextLeaf'\nimport type { RichTextReference } from './RichTextReference'\nimport { RichTextRendererError } from './RichTextRendererError'\nimport { RichTextRenderMetadataContext } from './RichTextRenderMetadataContext'\nimport type { RootEditorNode } from './RootEditorNode'\n\nexport interface RichTextRendererFieldProps {\n\tsource: string | null\n}\n\nexport interface RichTextRendererBlockProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n> {\n\tblocks: RichTextBlock[]\n\treferenceRenderers?: Record<string, ReferenceRenderer<any, CustomElements, CustomLeaves>>\n\tsourceField?: string\n\treferencesField?: string\n\treferenceDiscriminationField?: string\n}\n\nexport type RichTextRendererProps<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n> = {\n\tdeserialize?: (source: string) => RootEditorNode<CustomElements, CustomLeaves>\n\trenderElement?: RenderElement<CustomElements, CustomLeaves>\n\trenderLeaf?: RenderLeaf<CustomLeaves>\n\tattributeNamePrefix?: string\n} & (RichTextRendererFieldProps | RichTextRendererBlockProps<CustomElements, CustomLeaves>)\n\nexport const RichTextRenderer = memo(function RichTextRenderer<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n>({\n\tdeserialize = defaultDeserialize,\n\trenderElement,\n\trenderLeaf,\n\tattributeNamePrefix,\n\t...sourceProps\n}: RichTextRendererProps<CustomElements, CustomLeaves>) {\n\tconst normalizedSource = useMemo<NormalizedRichTextBlock<CustomElements, CustomLeaves>[]>(() => {\n\t\tif ('source' in sourceProps && !('blocks' in sourceProps)) {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tcontent: sourceProps.source\n\t\t\t\t\t\t? deserialize(sourceProps.source)\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tformatVersion: 0,\n\t\t\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\t },\n\t\t\t\t\tid: undefined,\n\t\t\t\t\treferencesField: undefined,\n\t\t\t\t\treferenceDiscriminationField: undefined,\n\t\t\t\t\treferenceRenderers: {},\n\t\t\t\t\treferences: undefined,\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\t\tif ('blocks' in sourceProps) {\n\t\t\tconst sourceField = sourceProps.sourceField ?? 'source'\n\t\t\tconst referencesField = sourceProps.referencesField ?? 'references'\n\t\t\tconst referenceDiscriminationField = sourceProps.referenceDiscriminationField ?? 'type'\n\n\t\t\treturn sourceProps.blocks.map(block => {\n\t\t\t\tif (!(sourceField in block)) {\n\t\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t\t`Found a block without a '${sourceField}' field. ` +\n\t\t\t\t\t\t\t(sourceProps.sourceField === undefined\n\t\t\t\t\t\t\t\t? `The 'sourceField' prop has not been supplied, and so '${sourceField}' was used as a default.`\n\t\t\t\t\t\t\t\t: `That is what the 'sourceField' prop has been set to, and so either this is a typo, ` +\n\t\t\t\t\t\t\t\t `or the data supplied is invalid.`),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tconst source = block[sourceField]\n\t\t\t\tif (typeof source !== 'string') {\n\t\t\t\t\tthrow new RichTextRendererError(`Found a block whose source is not a string.`)\n\t\t\t\t}\n\n\t\t\t\tif (sourceProps.referencesField !== undefined && !(referencesField in block)) {\n\t\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t\t`The 'referencesField' prop is set to '${referencesField}' but a block without such field ` +\n\t\t\t\t\t\t\t`has been encountered. Unless this is just a typo, ` +\n\t\t\t\t\t\t\t`if you do not wish to use references, avoid supplying the 'referencesField' prop.`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tconst references = block[referencesField]\n\n\t\t\t\tlet normalizedReferences: Map<string, RichTextReference> | undefined = undefined\n\t\t\t\tif (references) {\n\t\t\t\t\tif (typeof Object(references)[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new RichTextRendererError(`The set of references must be an iterable!`)\n\t\t\t\t\t}\n\n\t\t\t\t\tnormalizedReferences = new Map()\n\t\t\t\t\tfor (const reference of references as Iterable<RichTextReference>) {\n\t\t\t\t\t\tif (!('id' in reference)) {\n\t\t\t\t\t\t\tthrow new RichTextRendererError(`Found a reference without an id field.`)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!(referenceDiscriminationField in reference)) {\n\t\t\t\t\t\t\tthrow new RichTextRendererError(\n\t\t\t\t\t\t\t\t`Found a reference without a '${referenceDiscriminationField}' field. ` +\n\t\t\t\t\t\t\t\t\t(sourceProps.referenceDiscriminationField === undefined\n\t\t\t\t\t\t\t\t\t\t? `The 'referenceDiscriminationField' prop has not been supplied, ` +\n\t\t\t\t\t\t\t\t\t\t `and so '${referenceDiscriminationField}' was used as a default.`\n\t\t\t\t\t\t\t\t\t\t: `That is what the 'referenceDiscriminationField' prop has been set to, ` +\n\t\t\t\t\t\t\t\t\t\t `and so either this is a typo, or the data supplied is invalid.`),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnormalizedReferences.set(reference.id, reference)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tid: typeof block.id === 'string' ? block.id : undefined,\n\t\t\t\t\tcontent: deserialize(source),\n\t\t\t\t\treferenceDiscriminationField,\n\t\t\t\t\treferenceRenderers: sourceProps.referenceRenderers ?? {},\n\t\t\t\t\treferencesField,\n\t\t\t\t\treferences: normalizedReferences,\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tthrow new RichTextRendererError(`RichTextRenderer: invalid data supplied.`)\n\t}, [deserialize, sourceProps])\n\n\treturn (\n\t\t<>\n\t\t\t{normalizedSource.map((block, i) => (\n\t\t\t\t<RichTextRenderMetadataContext.Provider\n\t\t\t\t\tkey={block.id ?? i}\n\t\t\t\t\tvalue={{\n\t\t\t\t\t\tformatVersion: block.content.formatVersion,\n\t\t\t\t\t\treferenceRenderers: block.referenceRenderers,\n\t\t\t\t\t\treferencesField: block.referencesField,\n\t\t\t\t\t\treferenceDiscriminationField: block.referenceDiscriminationField,\n\t\t\t\t\t\treferences: block.references,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{renderChildren(block.content.children, {\n\t\t\t\t\t\trenderLeaf,\n\t\t\t\t\t\trenderElement,\n\t\t\t\t\t\tattributeNamePrefix,\n\t\t\t\t\t})}\n\t\t\t\t</RichTextRenderMetadataContext.Provider>\n\t\t\t))}\n\t\t</>\n\t)\n}) as <CustomElements extends RichTextElement = never, CustomLeaves extends RichTextLeaf = never>(\n\tprops: RichTextRendererProps<CustomElements, CustomLeaves>,\n) => ReactElement\n"],"names":[],"mappings":";;;;;;MAwCa,mBAAmB,KAAK,2BAGnC;AAAA,EACD,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,KACG;AAAA,GACoD;AACvD,QAAM,mBAAmB,QAAiE,MAAM;AAC/F,QAAI,YAAY,eAAe,cAAc,cAAc;AAC1D,aAAO;AAAA,QACN;AAAA,UACC,SAAS,YAAY,SAClB,YAAY,YAAY,UACxB;AAAA,YACA,eAAe;AAAA,YACf,UAAU;AAAA;AAAA,UAEb,IAAI;AAAA,UACJ,iBAAiB;AAAA,UACjB,8BAA8B;AAAA,UAC9B,oBAAoB;AAAA,UACpB,YAAY;AAAA;AAAA;AAAA;AAIf,QAAI,YAAY,aAAa;AAC5B,YAAM,cAAc,YAAY,eAAe;AAC/C,YAAM,kBAAkB,YAAY,mBAAmB;AACvD,YAAM,+BAA+B,YAAY,gCAAgC;AAEjF,aAAO,YAAY,OAAO,IAAI,WAAS;AACtC,YAAI,iBAAiB,QAAQ;AAC5B,gBAAM,IAAI,sBACT,4BAA4B,sCACd,gBAAgB,SAC1B,yDAAyD,wCACzD;AAAA;AAIN,cAAM,SAAS,MAAM;AACrB,YAAI,OAAO,WAAW,UAAU;AAC/B,gBAAM,IAAI,sBAAsB;AAAA;AAGjC,YAAI,YAAY,oBAAoB,UAAa,qBAAqB,QAAQ;AAC7E,gBAAM,IAAI,sBACT,yCAAyC;AAAA;AAK3C,cAAM,aAAa,MAAM;AAEzB,YAAI,uBAAmE;AACvE,YAAI,YAAY;AACf,cAAI,OAAO,OAAO,YAAY,OAAO,cAAc,YAAY;AAC9D,kBAAM,IAAI,sBAAsB;AAAA;AAGjC,iCAAuB,IAAI;AAC3B,qBAAW,aAAa,YAA2C;AAClE,gBAAI,UAAU,YAAY;AACzB,oBAAM,IAAI,sBAAsB;AAAA;AAEjC,gBAAI,kCAAkC,YAAY;AACjD,oBAAM,IAAI,sBACT,gCAAgC,uDAClB,iCAAiC,SAC3C,0EACW,yDACX;AAAA;AAIN,iCAAqB,IAAI,UAAU,IAAI;AAAA;AAAA;AAGzC,eAAO;AAAA,UACN,IAAI,OAAO,MAAM,OAAO,WAAW,MAAM,KAAK;AAAA,UAC9C,SAAS,YAAY;AAAA,UACrB;AAAA,UACA,oBAAoB,YAAY,sBAAsB;AAAA,UACtD;AAAA,UACA,YAAY;AAAA;AAAA;AAAA;AAIf,UAAM,IAAI,sBAAsB;AAAA,KAC9B,CAAC,aAAa;AAEjB,uDAEG,iBAAiB,IAAI,CAAC,OAAO,oCAC5B,8BAA8B,UAA/B;AAAA,IACC,KAAK,MAAM,MAAM;AAAA,IACjB,OAAO;AAAA,MACN,eAAe,MAAM,QAAQ;AAAA,MAC7B,oBAAoB,MAAM;AAAA,MAC1B,iBAAiB,MAAM;AAAA,MACvB,8BAA8B,MAAM;AAAA,MACpC,YAAY,MAAM;AAAA;AAAA,KAGlB,eAAe,MAAM,QAAQ,UAAU;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA;AAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichTextRendererError.js","sources":["../../../../src/components/RichTextRenderer/RichTextRendererError.ts"],"sourcesContent":["export class RichTextRendererError extends Error {}\n"],"names":[],"mappings":"oCAA2C,MAAM;AAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultDeserialize.js","sources":["../../../../src/components/RichTextRenderer/defaultDeserialize.ts"],"sourcesContent":["import type { RichTextElement } from './RichTextElement'\nimport type { RichTextLeaf } from './RichTextLeaf'\nimport type { RootEditorNode } from './RootEditorNode'\n\nexport const defaultDeserialize = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n>(\n\tsource: string,\n): RootEditorNode<CustomElements, CustomLeaves> => {\n\ttry {\n\t\treturn JSON.parse(source)\n\t} catch (e) {\n\t\treturn {\n\t\t\tformatVersion: 0,\n\t\t\tchildren: [],\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"MAIa,qBAAqB,CAIjC,WACkD;AAClD,MAAI;AACH,WAAO,KAAK,MAAM;AAAA,WACV,GAAP;AACD,WAAO;AAAA,MACN,eAAe;AAAA,MACf,UAAU;AAAA;AAAA;AAAA;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createElement, Fragment } from 'react';
|
|
2
|
+
import { ElementRenderer } from './ElementRenderer.js';
|
|
3
|
+
import { LeafRenderer } from './LeafRenderer.js';
|
|
4
|
+
|
|
5
|
+
const renderChildren = (children, options) => {
|
|
6
|
+
if (!Array.isArray(children)) {
|
|
7
|
+
children = [children];
|
|
8
|
+
}
|
|
9
|
+
return /* @__PURE__ */ createElement(Fragment, null, children.map((child, i) => {
|
|
10
|
+
if ("text" in child) {
|
|
11
|
+
return /* @__PURE__ */ createElement(LeafRenderer, {
|
|
12
|
+
key: i,
|
|
13
|
+
leaf: child,
|
|
14
|
+
renderLeaf: options.renderLeaf
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
if ("children" in child) {
|
|
18
|
+
return /* @__PURE__ */ createElement(ElementRenderer, {
|
|
19
|
+
key: i,
|
|
20
|
+
element: child,
|
|
21
|
+
options
|
|
22
|
+
}, renderChildren(child.children, options));
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}));
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { renderChildren };
|
|
29
|
+
//# sourceMappingURL=renderChildren.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderChildren.js","sources":["../../../../src/components/RichTextRenderer/renderChildren.tsx"],"sourcesContent":["import type { ReactElement } from 'react'\nimport type { BuiltinElements } from './BuiltinElements'\nimport type { BuiltinLeaves } from './BuiltinLeaves'\nimport { ElementRenderer, RenderElement } from './ElementRenderer'\nimport { LeafRenderer, RenderLeaf } from './LeafRenderer'\nimport type { RichTextElement } from './RichTextElement'\nimport type { RichTextLeaf } from './RichTextLeaf'\n\nexport interface RenderChildrenOptions<\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n> {\n\trenderElement?: RenderElement<CustomElements, CustomLeaves>\n\trenderLeaf?: RenderLeaf<CustomLeaves>\n\tattributeNamePrefix?: string\n}\n\nexport const renderChildren = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n>(\n\tchildren:\n\t\t| CustomElements\n\t\t| BuiltinElements<CustomElements, CustomLeaves>\n\t\t| CustomLeaves\n\t\t| BuiltinLeaves\n\t\t| Array<CustomElements | BuiltinElements<CustomElements, CustomLeaves> | CustomLeaves | BuiltinLeaves>,\n\toptions: RenderChildrenOptions<CustomElements, CustomLeaves>,\n): ReactElement => {\n\tif (!Array.isArray(children)) {\n\t\tchildren = [children]\n\t}\n\treturn (\n\t\t<>\n\t\t\t{children.map((child, i) => {\n\t\t\t\tif ('text' in child) {\n\t\t\t\t\treturn <LeafRenderer<CustomLeaves> key={i} leaf={child} renderLeaf={options.renderLeaf} />\n\t\t\t\t}\n\t\t\t\tif ('children' in child) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ElementRenderer<CustomElements, CustomLeaves> key={i} element={child} options={options}>\n\t\t\t\t\t\t\t{renderChildren<CustomElements, CustomLeaves>(child.children as typeof children, options)}\n\t\t\t\t\t\t</ElementRenderer>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\treturn null // Throw?\n\t\t\t})}\n\t\t</>\n\t)\n}\n"],"names":[],"mappings":";;;;MAiBa,iBAAiB,CAI7B,UAMA,YACkB;AAClB,MAAI,CAAC,MAAM,QAAQ,WAAW;AAC7B,eAAW,CAAC;AAAA;AAEb,uDAEG,SAAS,IAAI,CAAC,OAAO,MAAM;AAC3B,QAAI,UAAU,OAAO;AACpB,2CAAQ,cAAD;AAAA,QAA4B,KAAK;AAAA,QAAG,MAAM;AAAA,QAAO,YAAY,QAAQ;AAAA;AAAA;AAE7E,QAAI,cAAc,OAAO;AACxB,2CACE,iBAAD;AAAA,QAA+C,KAAK;AAAA,QAAG,SAAS;AAAA,QAAO;AAAA,SACrE,eAA6C,MAAM,UAA6B;AAAA;AAIpF,WAAO;AAAA;AAAA;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { RichTextRendererError } from './RichTextRendererError.js';
|
|
2
|
+
|
|
3
|
+
const resolveRichTextElementMetadata = (element, metadata) => {
|
|
4
|
+
let reference = void 0;
|
|
5
|
+
if ("referenceId" in element && typeof element["referenceId"] === "string") {
|
|
6
|
+
const resolved = metadata.references?.get(element["referenceId"]);
|
|
7
|
+
if (resolved === void 0) {
|
|
8
|
+
throw new RichTextRendererError(`Cannot find reference id '${element["referenceId"]}'` + (metadata.references === void 0 ? ` because its containing block's lacks the '${metadata.referencesField}' field. ` : `.`));
|
|
9
|
+
}
|
|
10
|
+
reference = resolved;
|
|
11
|
+
}
|
|
12
|
+
let referenceRenderer = void 0;
|
|
13
|
+
let referenceType = void 0;
|
|
14
|
+
if (reference && metadata.referenceDiscriminationField) {
|
|
15
|
+
referenceType = reference[metadata.referenceDiscriminationField];
|
|
16
|
+
referenceRenderer = metadata.referenceRenderers[referenceType];
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
formatVersion: metadata.formatVersion,
|
|
20
|
+
reference,
|
|
21
|
+
referenceType,
|
|
22
|
+
referenceRenderer
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { resolveRichTextElementMetadata };
|
|
27
|
+
//# sourceMappingURL=resolveRichTextElementMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRichTextElementMetadata.js","sources":["../../../../src/components/RichTextRenderer/resolveRichTextElementMetadata.ts"],"sourcesContent":["import type { BuiltinElements } from './BuiltinElements'\nimport type { ReferenceRenderer } from './ReferenceRenderer'\nimport type { RichTextElement } from './RichTextElement'\nimport type { RichTextElementMetadata } from './RichTextElementMetadata'\nimport type { RichTextLeaf } from './RichTextLeaf'\nimport type { RichTextReference } from './RichTextReference'\nimport { RichTextRendererError } from './RichTextRendererError'\nimport type { RichTextRenderMetadata } from './RichTextRenderMetadata'\n\nexport const resolveRichTextElementMetadata = <\n\tCustomElements extends RichTextElement = never,\n\tCustomLeaves extends RichTextLeaf = never,\n\tReference extends RichTextReference = RichTextReference,\n>(\n\telement: CustomElements | BuiltinElements<CustomElements, CustomLeaves>,\n\tmetadata: RichTextRenderMetadata<CustomElements, CustomLeaves, Reference>,\n): RichTextElementMetadata<CustomElements, CustomLeaves, Reference> => {\n\tlet reference: Reference | undefined = undefined\n\n\tif ('referenceId' in element && typeof element['referenceId'] === 'string') {\n\t\tconst resolved = metadata.references?.get(element['referenceId'])\n\n\t\tif (resolved === undefined) {\n\t\t\tthrow new RichTextRendererError(\n\t\t\t\t`Cannot find reference id '${element['referenceId']}'` +\n\t\t\t\t\t(metadata.references === undefined\n\t\t\t\t\t\t? ` because its containing block's lacks the '${metadata.referencesField}' field. `\n\t\t\t\t\t\t: `.`),\n\t\t\t)\n\t\t}\n\t\treference = resolved as Reference\n\t}\n\n\tlet referenceRenderer: ReferenceRenderer<Reference, CustomElements, CustomLeaves> | undefined = undefined\n\tlet referenceType: string | undefined = undefined\n\n\tif (reference && metadata.referenceDiscriminationField) {\n\t\treferenceType = (reference as Reference & Record<typeof metadata.referenceDiscriminationField, string>)[\n\t\t\tmetadata.referenceDiscriminationField\n\t\t]\n\t\treferenceRenderer = metadata.referenceRenderers[referenceType]\n\t}\n\n\treturn {\n\t\tformatVersion: metadata.formatVersion,\n\t\treference,\n\t\treferenceType,\n\t\treferenceRenderer,\n\t}\n}\n"],"names":[],"mappings":";;MASa,iCAAiC,CAK7C,SACA,aACsE;AACtE,MAAI,YAAmC;AAEvC,MAAI,iBAAiB,WAAW,OAAO,QAAQ,mBAAmB,UAAU;AAC3E,UAAM,WAAW,SAAS,YAAY,IAAI,QAAQ;AAElD,QAAI,aAAa,QAAW;AAC3B,YAAM,IAAI,sBACT,6BAA6B,QAAQ,8BAC1B,eAAe,SACtB,8CAA8C,SAAS,6BACvD;AAAA;AAGN,gBAAY;AAAA;AAGb,MAAI,oBAA4F;AAChG,MAAI,gBAAoC;AAExC,MAAI,aAAa,SAAS,8BAA8B;AACvD,oBAAiB,UAChB,SAAS;AAEV,wBAAoB,SAAS,mBAAmB;AAAA;AAGjD,SAAO;AAAA,IACN,eAAe,SAAS;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA;AAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiBaseUrlContext.js","sources":["../../../src/config/ApiBaseUrlContext.ts"],"sourcesContent":["import { createContext } from 'react'\n\nexport const ApiBaseUrlContext = createContext<string | undefined>(undefined)\n"],"names":[],"mappings":";;MAEa,oBAAoB,cAAkC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoginTokenContext.js","sources":["../../../src/config/LoginTokenContext.ts"],"sourcesContent":["import { createContext } from 'react'\n\nexport const LoginTokenContext = createContext<string | undefined>(undefined)\n"],"names":[],"mappings":";;MAEa,oBAAoB,cAAkC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useApiBaseUrl.js","sources":["../../../src/config/useApiBaseUrl.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { ApiBaseUrlContext } from './ApiBaseUrlContext'\n\nexport const useApiBaseUrl = () => useContext(ApiBaseUrlContext)\n"],"names":[],"mappings":";;;MAGa,gBAAgB,MAAM,WAAW;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLoginToken.js","sources":["../../../src/config/useLoginToken.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { LoginTokenContext } from './LoginTokenContext'\n\nexport const useLoginToken = () => useContext(LoginTokenContext)\n"],"names":[],"mappings":";;;MAGa,gBAAgB,MAAM,WAAW;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useCurrentContentGraphQlClient } from './useCurrentContentGraphQlClient.js';
|
|
2
|
+
import { useApiRequest } from '../apiRequest/useApiRequest.js';
|
|
3
|
+
|
|
4
|
+
const useContentApiRequest = () => useApiRequest(useCurrentContentGraphQlClient());
|
|
5
|
+
|
|
6
|
+
export { useContentApiRequest };
|
|
7
|
+
//# sourceMappingURL=useContentApiRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useContentApiRequest.js","sources":["../../../src/content/useContentApiRequest.ts"],"sourcesContent":["import type { UseApiRequestResult } from '../apiRequest'\nimport { useApiRequest } from '../apiRequest'\nimport { useCurrentContentGraphQlClient } from './useCurrentContentGraphQlClient'\n\nexport const useContentApiRequest = <SuccessData>(): UseApiRequestResult<SuccessData> =>\n\tuseApiRequest<SuccessData>(useCurrentContentGraphQlClient())\n"],"names":[],"mappings":";;;MAIa,uBAAuB,MACnC,cAA2B;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { formatContentApiRelativeUrl } from '@contember/client';
|
|
2
|
+
import { useGraphQlClient } from '../useGraphQlClient.js';
|
|
3
|
+
|
|
4
|
+
const useContentGraphQlClient = (projectSlug, stageSlug) => useGraphQlClient(formatContentApiRelativeUrl(projectSlug, stageSlug));
|
|
5
|
+
|
|
6
|
+
export { useContentGraphQlClient };
|
|
7
|
+
//# sourceMappingURL=useContentGraphQlClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useContentGraphQlClient.js","sources":["../../../src/content/useContentGraphQlClient.ts"],"sourcesContent":["import type { GraphQlClient } from '@contember/client'\nimport { formatContentApiRelativeUrl } from '@contember/client'\nimport { useGraphQlClient } from '../useGraphQlClient'\n\nexport const useContentGraphQlClient = (projectSlug: string, stageSlug: string): GraphQlClient =>\n\tuseGraphQlClient(formatContentApiRelativeUrl(projectSlug, stageSlug))\n"],"names":[],"mappings":";;;MAIa,0BAA0B,CAAC,aAAqB,cAC5D,iBAAiB,4BAA4B,aAAa;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ClientError } from '../ClientError.js';
|
|
2
|
+
import { useContentGraphQlClient } from './useContentGraphQlClient.js';
|
|
3
|
+
import { useProjectSlug } from '../project/useProjectSlug.js';
|
|
4
|
+
import { useStageSlug } from '../project/useStageSlug.js';
|
|
5
|
+
|
|
6
|
+
const useCurrentContentGraphQlClient = () => {
|
|
7
|
+
const projectSlug = useProjectSlug();
|
|
8
|
+
const stageSlug = useStageSlug();
|
|
9
|
+
if (projectSlug === void 0) {
|
|
10
|
+
throw new ClientError(`Cannot contact the content API: undefined project slug.`);
|
|
11
|
+
}
|
|
12
|
+
if (stageSlug === void 0) {
|
|
13
|
+
throw new ClientError(`Cannot contact the content API: undefined stage slug.`);
|
|
14
|
+
}
|
|
15
|
+
return useContentGraphQlClient(projectSlug, stageSlug);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { useCurrentContentGraphQlClient };
|
|
19
|
+
//# sourceMappingURL=useCurrentContentGraphQlClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCurrentContentGraphQlClient.js","sources":["../../../src/content/useCurrentContentGraphQlClient.ts"],"sourcesContent":["import type { GraphQlClient } from '@contember/client'\nimport { ClientError } from '../ClientError'\nimport { useProjectSlug, useStageSlug } from '../project'\nimport { useContentGraphQlClient } from './useContentGraphQlClient'\n\nexport const useCurrentContentGraphQlClient = (): GraphQlClient => {\n\tconst projectSlug = useProjectSlug()\n\tconst stageSlug = useStageSlug()\n\n\tif (projectSlug === undefined) {\n\t\tthrow new ClientError(`Cannot contact the content API: undefined project slug.`)\n\t}\n\tif (stageSlug === undefined) {\n\t\tthrow new ClientError(`Cannot contact the content API: undefined stage slug.`)\n\t}\n\treturn useContentGraphQlClient(projectSlug, stageSlug)\n}\n"],"names":[],"mappings":";;;;;MAKa,iCAAiC,MAAqB;AAClE,QAAM,cAAc;AACpB,QAAM,YAAY;AAElB,MAAI,gBAAgB,QAAW;AAC9B,UAAM,IAAI,YAAY;AAAA;AAEvB,MAAI,cAAc,QAAW;AAC5B,UAAM,IAAI,YAAY;AAAA;AAEvB,SAAO,wBAAwB,aAAa;AAAA;;;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { ContemberClient } from './ContemberClient.js';
|
|
2
|
+
export { ClientError } from './ClientError.js';
|
|
3
|
+
export { useGraphQlClient } from './useGraphQlClient.js';
|
|
4
|
+
export * from '@contember/client';
|
|
5
|
+
export { apiRequestReducer } from './apiRequest/apiRequestReducer.js';
|
|
6
|
+
export { useApiRequest } from './apiRequest/useApiRequest.js';
|
|
7
|
+
export { SessionTokenContext } from './auth/SessionTokenContext.js';
|
|
8
|
+
export { useLoginRequest } from './auth/useLoginRequest.js';
|
|
9
|
+
export { useSessionToken } from './auth/useSessionToken.js';
|
|
10
|
+
export { RichTextRenderer } from './components/RichTextRenderer/RichTextRenderer.js';
|
|
11
|
+
export { RichTextRendererError } from './components/RichTextRenderer/RichTextRendererError.js';
|
|
12
|
+
export { ApiBaseUrlContext } from './config/ApiBaseUrlContext.js';
|
|
13
|
+
export { LoginTokenContext } from './config/LoginTokenContext.js';
|
|
14
|
+
export { useApiBaseUrl } from './config/useApiBaseUrl.js';
|
|
15
|
+
export { useLoginToken } from './config/useLoginToken.js';
|
|
16
|
+
export { useContentApiRequest } from './content/useContentApiRequest.js';
|
|
17
|
+
export { useContentGraphQlClient } from './content/useContentGraphQlClient.js';
|
|
18
|
+
export { useCurrentContentGraphQlClient } from './content/useCurrentContentGraphQlClient.js';
|
|
19
|
+
export { ProjectSlugContext } from './project/ProjectSlugContext.js';
|
|
20
|
+
export { StageSlugContext } from './project/StageSlugContext.js';
|
|
21
|
+
export { useProjectSlug } from './project/useProjectSlug.js';
|
|
22
|
+
export { useStageSlug } from './project/useStageSlug.js';
|
|
23
|
+
export { useCurrentSystemGraphQlClient } from './system/useCurrentSystemGraphQlClient.js';
|
|
24
|
+
export { useDiffQuery } from './system/useDiffQuery.js';
|
|
25
|
+
export { useReleaseTreeMutation } from './system/useReleaseTreeMutation.js';
|
|
26
|
+
export { useSystemApiRequest } from './system/useSystemApiRequest.js';
|
|
27
|
+
export { useSystemGraphQlClient } from './system/useSystemGraphQlClient.js';
|
|
28
|
+
export { useTenantApiRequest } from './tenant/useTenantApiRequest.js';
|
|
29
|
+
export { useTenantGraphQlClient } from './tenant/useTenantGraphQlClient.js';
|
|
30
|
+
export { useFileUpload } from './upload/useFileUpload.js';
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectSlugContext.js","sources":["../../../src/project/ProjectSlugContext.ts"],"sourcesContent":["import { createContext } from 'react'\n\nexport const ProjectSlugContext = createContext<string | undefined>(undefined)\n"],"names":[],"mappings":";;MAEa,qBAAqB,cAAkC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StageSlugContext.js","sources":["../../../src/project/StageSlugContext.ts"],"sourcesContent":["import { createContext } from 'react'\n\nexport const StageSlugContext = createContext<string | undefined>(undefined)\n"],"names":[],"mappings":";;MAEa,mBAAmB,cAAkC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProjectSlug.js","sources":["../../../src/project/useProjectSlug.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { ProjectSlugContext } from './ProjectSlugContext'\n\nexport const useProjectSlug = () => useContext(ProjectSlugContext)\n"],"names":[],"mappings":";;;MAGa,iBAAiB,MAAM,WAAW;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStageSlug.js","sources":["../../../src/project/useStageSlug.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { StageSlugContext } from './StageSlugContext'\n\nexport const useStageSlug = () => useContext(StageSlugContext)\n"],"names":[],"mappings":";;;MAGa,eAAe,MAAM,WAAW;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ClientError } from '../ClientError.js';
|
|
2
|
+
import { useSystemGraphQlClient } from './useSystemGraphQlClient.js';
|
|
3
|
+
import { useProjectSlug } from '../project/useProjectSlug.js';
|
|
4
|
+
|
|
5
|
+
const useCurrentSystemGraphQlClient = () => {
|
|
6
|
+
const projectSlug = useProjectSlug();
|
|
7
|
+
if (projectSlug === void 0) {
|
|
8
|
+
throw new ClientError(`Cannot contact the system API: undefined project slug.`);
|
|
9
|
+
}
|
|
10
|
+
return useSystemGraphQlClient(projectSlug);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { useCurrentSystemGraphQlClient };
|
|
14
|
+
//# sourceMappingURL=useCurrentSystemGraphQlClient.js.map
|