@lodado/sdui-template 1.0.0 → 1.0.2
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/README.md +253 -3
- package/dist/cjs/client/index.cjs +1 -1
- package/dist/es/client/_virtual/_tslib.mjs +1 -0
- package/dist/es/client/node_modules/.pnpm/@testing-library_dom@10.4.1/node_modules/@testing-library/dom/dist/@testing-library/dom.esm.mjs +1 -0
- package/dist/es/client/node_modules/.pnpm/@testing-library_react@16.3.1_@testing-library_dom@10.4.1_@types_react-dom@18.3.7_@types_reac_bxcobvx7qxffu3uqpqwx2mjx3m/node_modules/@testing-library/react/dist/@testing-library/react.esm.mjs +1 -0
- package/dist/es/client/node_modules/.pnpm/dom-accessibility-api@0.5.16/node_modules/dom-accessibility-api/dist/accessible-description.mjs +1 -0
- package/dist/es/client/node_modules/.pnpm/dom-accessibility-api@0.5.16/node_modules/dom-accessibility-api/dist/accessible-name-and-description.mjs +1 -0
- package/dist/es/client/node_modules/.pnpm/dom-accessibility-api@0.5.16/node_modules/dom-accessibility-api/dist/accessible-name.mjs +1 -0
- package/dist/es/client/node_modules/.pnpm/dom-accessibility-api@0.5.16/node_modules/dom-accessibility-api/dist/getRole.mjs +1 -0
- package/dist/es/client/node_modules/.pnpm/dom-accessibility-api@0.5.16/node_modules/dom-accessibility-api/dist/polyfills/SetLike.mjs +1 -0
- package/dist/es/client/node_modules/.pnpm/dom-accessibility-api@0.5.16/node_modules/dom-accessibility-api/dist/polyfills/array.from.mjs +1 -0
- package/dist/es/client/node_modules/.pnpm/dom-accessibility-api@0.5.16/node_modules/dom-accessibility-api/dist/util.mjs +1 -0
- package/dist/es/client/src/__tests__/index.mjs +1 -0
- package/dist/es/client/src/__tests__/utils/dev-utils.mjs +1 -0
- package/dist/es/client/src/components/DefaultNodeComponent.mjs +2 -0
- package/dist/es/client/src/components/componentMap.mjs +1 -1
- package/dist/es/client/src/components/defaultComponentFactory.mjs +1 -0
- package/dist/es/client/src/index.mjs +1 -1
- package/dist/es/client/src/react-wrapper/components/SduiLayoutRenderer.mjs +1 -1
- package/dist/es/client/src/react-wrapper/hooks/useRenderNode.mjs +1 -1
- package/dist/es/client/src/react-wrapper/hooks/useSduiNodeReference.mjs +2 -0
- package/dist/es/client/src/react-wrapper/hooks/useSduiNodeSubscription.mjs +1 -1
- package/dist/es/client/src/react-wrapper/hooks/useSduiNodeSubscriptionSync.mjs +2 -0
- package/dist/es/client/src/store/SduiLayoutStore.mjs +1 -1
- package/dist/es/client/src/store/managers/LayoutStateRepository.mjs +1 -1
- package/dist/es/client/src/store/managers/SubscriptionManager.mjs +1 -1
- package/dist/es/client/src/utils/normalize/denormalize.mjs +1 -1
- package/dist/es/client/src/utils/normalize/normalize.mjs +1 -1
- package/dist/es/client/src/utils/parentPath.mjs +1 -0
- package/dist/types/src/__tests__/index.d.ts +7 -0
- package/dist/types/src/__tests__/utils/dev-utils.d.ts +48 -0
- package/dist/types/src/components/DefaultNodeComponent.d.ts +15 -0
- package/dist/types/src/components/componentMap.d.ts +12 -9
- package/dist/types/src/components/defaultComponentFactory.d.ts +14 -0
- package/dist/types/src/components/index.d.ts +3 -2
- package/dist/types/src/components/types.d.ts +30 -8
- package/dist/types/src/index.d.ts +5 -3
- package/dist/types/src/react-wrapper/components/SduiLayoutRenderer.d.ts +9 -9
- package/dist/types/src/react-wrapper/context/SduiLayoutContext.d.ts +8 -8
- package/dist/types/src/react-wrapper/context/index.d.ts +1 -1
- package/dist/types/src/react-wrapper/hooks/index.d.ts +2 -0
- package/dist/types/src/react-wrapper/hooks/useRenderNode.d.ts +47 -6
- package/dist/types/src/react-wrapper/hooks/useSduiLayoutAction.d.ts +2 -2
- package/dist/types/src/react-wrapper/hooks/useSduiNodeReference.d.ts +67 -0
- package/dist/types/src/react-wrapper/hooks/useSduiNodeSubscription.d.ts +34 -17
- package/dist/types/src/react-wrapper/hooks/useSduiNodeSubscriptionSync.d.ts +37 -0
- package/dist/types/src/schema/base.d.ts +17 -15
- package/dist/types/src/schema/document.d.ts +5 -5
- package/dist/types/src/schema/index.d.ts +1 -1
- package/dist/types/src/schema/node.d.ts +11 -7
- package/dist/types/src/store/SduiLayoutStore.d.ts +126 -83
- package/dist/types/src/store/index.d.ts +1 -1
- package/dist/types/src/store/managers/DocumentManager.d.ts +22 -22
- package/dist/types/src/store/managers/LayoutStateRepository.d.ts +111 -37
- package/dist/types/src/store/managers/SubscriptionManager.d.ts +31 -17
- package/dist/types/src/store/managers/VariablesManager.d.ts +11 -11
- package/dist/types/src/store/managers/index.d.ts +1 -1
- package/dist/types/src/store/types.d.ts +26 -20
- package/dist/types/src/utils/normalize/denormalize.d.ts +10 -10
- package/dist/types/src/utils/normalize/normalize.d.ts +8 -8
- package/dist/types/src/utils/normalize/types.d.ts +4 -4
- package/dist/types/src/utils/parentPath.d.ts +58 -0
- package/package.json +54 -33
- package/src/__tests__/index.ts +7 -0
- package/src/__tests__/scenario/boundary-values.test.tsx +250 -0
- package/src/__tests__/scenario/component-override.test.tsx +68 -0
- package/src/__tests__/scenario/dynamic-document-merge.test.tsx +405 -0
- package/src/__tests__/scenario/error-handling.test.tsx +35 -0
- package/src/__tests__/scenario/node-not-found.test.tsx +236 -0
- package/src/__tests__/scenario/node-reference-subscription.test.tsx +461 -0
- package/src/__tests__/scenario/node-reference.test.tsx +670 -0
- package/src/__tests__/scenario/parent-path.test.tsx +198 -0
- package/src/__tests__/scenario/recursive-rendering.test.tsx +260 -0
- package/src/__tests__/scenario/render-document.test.tsx +98 -0
- package/src/__tests__/scenario/reset-to-initial.test.tsx +227 -0
- package/src/__tests__/scenario/store-reset.test.tsx +54 -0
- package/src/__tests__/scenario/subscription.test.tsx +146 -0
- package/src/__tests__/scenario/sync-external-store.test.tsx +392 -0
- package/src/__tests__/scenario/test-coverage.md +95 -0
- package/src/__tests__/scenario/timestamp-snapshot.test.tsx +420 -0
- package/src/__tests__/scenario/update-layout.test.tsx +103 -0
- package/src/__tests__/scenario/zod-validation.test.tsx +298 -0
- package/src/__tests__/utils/dev-utils.tsx +175 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";import*as t from"react-dom/test-utils";import r from"react-dom";import*as o from"react-dom/client";import{fireEvent as n,configure as l,getQueriesForElement as a,prettyDOM as i,getConfig as u}from"../../../../../../@testing-library_dom@10.4.1/node_modules/@testing-library/dom/dist/@testing-library/dom.esm.mjs";export{buildQueries,createEvent,findAllByAltText,findAllByDisplayValue,findAllByLabelText,findAllByPlaceholderText,findAllByRole,findAllByTestId,findAllByText,findAllByTitle,findByAltText,findByDisplayValue,findByLabelText,findByPlaceholderText,findByRole,findByTestId,findByText,findByTitle,getAllByAltText,getAllByDisplayValue,getAllByLabelText,getAllByPlaceholderText,getAllByRole,getAllByTestId,getAllByText,getAllByTitle,getByAltText,getByDisplayValue,getByLabelText,getByPlaceholderText,getByRole,getByTestId,getByText,getByTitle,getDefaultNormalizer,getElementError,getMultipleElementsFoundError,getNodeText,getRoles,getSuggestedQuery,isInaccessible,logDOM,makeFindQuery,makeGetAllQuery,makeSingleQuery,queries,queryAllByAltText,queryAllByAttribute,queryAllByDisplayValue,queryAllByLabelText,queryAllByPlaceholderText,queryAllByRole,queryAllByTestId,queryAllByText,queryAllByTitle,queryByAltText,queryByDisplayValue,queryByLabelText,queryByPlaceholderText,queryByRole,queryByTestId,queryByText,queryByTitle,waitFor,wrapAllByQueryWithSuggestion,wrapSingleQueryWithSuggestion}from"../../../../../../@testing-library_dom@10.4.1/node_modules/@testing-library/dom/dist/@testing-library/dom.esm.mjs";const c="function"==typeof e.act?e.act:t.act;function y(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}function d(e){y().IS_REACT_ACT_ENVIRONMENT=e}function s(){return y().IS_REACT_ACT_ENVIRONMENT}const f=(p=c,e=>{const t=s();d(!0);try{let r=!1;const o=p(()=>{const t=e();return null!==t&&"object"==typeof t&&"function"==typeof t.then&&(r=!0),t});if(r){const e=o;return{then:(r,o)=>{e.then(e=>{d(t),r(e)},e=>{d(t),o(e)})}}}return d(t),o}catch(e){throw d(t),e}});var p;Object.keys(n).forEach(e=>{});let g={reactStrictMode:!1};function m(){return{...u(),...g}}l({unstable_advanceTimersWrapper:e=>f(e),asyncWrapper:async e=>{const t=s();d(!1);try{const t=await e();return await new Promise(e=>{setTimeout(()=>{e()},0),"undefined"==typeof jest||null===jest||!0!==setTimeout._isMockFunction&&!Object.prototype.hasOwnProperty.call(setTimeout,"clock")||jest.advanceTimersByTime(0)}),t}finally{d(t)}},eventWrapper:e=>{let t;return f(()=>{t=e()}),t}});const h=new Set,T=[];function B(t,r){return r??m().reactStrictMode?e.createElement(e.StrictMode,null,t):t}function A(t,r){return r?e.createElement(r,null,t):t}function b(e,{hydrate:t,onCaughtError:r,onRecoverableError:n,ui:l,wrapper:a,reactStrictMode:i}){let u;return t?f(()=>{u=o.hydrateRoot(e,B(A(l,a),i),{onCaughtError:r,onRecoverableError:n})}):u=o.createRoot(e,{onCaughtError:r,onRecoverableError:n}),{hydrate(){if(!t)throw new Error("Attempted to hydrate a non-hydrateable root. This is a bug in `@testing-library/react`.")},render(e){u.render(e)},unmount(){u.unmount()}}}function E(e){return{hydrate(t){r.hydrate(t,e)},render(t){r.render(t,e)},unmount(){r.unmountComponentAtNode(e)}}}function w(e,{baseElement:t,container:r,hydrate:o,queries:n,root:l,wrapper:u,reactStrictMode:c}){return f(()=>{o?l.hydrate(B(A(e,u),c),r):l.render(B(A(e,u),c),r)}),{container:r,baseElement:t,debug:(e=t,r,o)=>Array.isArray(e)?e.forEach(e=>console.log(i(e,r,o))):console.log(i(e,r,o)),unmount:()=>{f(()=>{l.unmount()})},rerender:e=>{w(e,{container:r,baseElement:t,root:l,wrapper:u,reactStrictMode:c})},asFragment:()=>{if("function"==typeof document.createRange)return document.createRange().createContextualFragment(r.innerHTML);{const e=document.createElement("template");return e.innerHTML=r.innerHTML,e.content}},...a(t,n)}}function x(e,{container:t,baseElement:o=t,legacyRoot:n=!1,onCaughtError:l,onUncaughtError:a,onRecoverableError:i,queries:u,hydrate:c=!1,wrapper:y,reactStrictMode:d}={}){if(void 0!==a)throw new Error("onUncaughtError is not supported. The `render` call will already throw on uncaught errors.");if(n&&"function"!=typeof r.render){const e=new Error("`legacyRoot: true` is not supported in this version of React. If your app runs React 19 or later, you should remove this flag. If your app runs React 18 or earlier, visit https://react.dev/blog/2022/03/08/react-18-upgrade-guide for upgrade instructions.");throw Error.captureStackTrace(e,x),e}let s;if(o||(o=document.body),t||(t=o.appendChild(document.createElement("div"))),h.has(t))T.forEach(e=>{e.container===t&&(s=e.root)});else{s=(n?E:b)(t,{hydrate:c,onCaughtError:l,onRecoverableError:i,ui:e,wrapper:y,reactStrictMode:d}),T.push({container:t,root:s}),h.add(t)}return w(e,{container:t,baseElement:o,queries:u,hydrate:c,wrapper:y,root:s,reactStrictMode:d})}function R(){T.forEach(({root:e,container:t})=>{f(()=>{e.unmount()}),t.parentNode===document.body&&document.body.removeChild(t)}),T.length=0,h.clear()}if(("undefined"==typeof process||!process.env?.RTL_SKIP_AUTO_CLEANUP)&&("function"==typeof afterEach?afterEach(()=>{R()}):"function"==typeof teardown&&teardown(()=>{R()}),"function"==typeof beforeAll&&"function"==typeof afterAll)){let e=s();beforeAll(()=>{e=s(),d(!0)}),afterAll(()=>{d(e)})}export{f as act,R as cleanup,m as getConfig,a as getQueriesForElement,i as prettyDOM,x as render,a as within};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{computeTextAlternative as t}from"./accessible-name-and-description.mjs";import{queryIdRefs as r}from"./util.mjs";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function o(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?n(Object(e),!0).forEach(function(r){i(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):n(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function i(t,r,n){return(r=function(t){var r=function(t,r){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r);if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"===e(r)?r:String(r)}(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function c(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r(e,"aria-describedby").map(function(r){return t(r,o(o({},n),{},{compute:"description"}))}).join(" ");if(""===i){var c=e.getAttribute("title");i=null===c?"":c}return i}export{c as computeAccessibleDescription};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./polyfills/array.from.mjs";import r from"./polyfills/SetLike.mjs";import{safeWindow as t,isElement as n,queryIdRefs as i,hasAnyConcreteRoles as u,isHTMLInputElement as a,isHTMLFieldSetElement as l,isHTMLLegendElement as o,isHTMLTableElement as d,isHTMLTableCaptionElement as f,isSVGSVGElement as c,isSVGTitleElement as s,isHTMLOptGroupElement as b,isHTMLSelectElement as m,isHTMLTextAreaElement as v,isHTMLSlotElement as p}from"./util.mjs";import{getLocalName as g}from"./getRole.mjs";function h(e,r){if(!n(e))return!1;if("range"===r)return u(e,["meter","progressbar","scrollbar","slider","spinbutton"]);throw new TypeError("No knowledge about abstract role '".concat(r,"'. This is likely a bug :("))}function y(r,t){var n=e(r.querySelectorAll(t));return i(r,"aria-owns").forEach(function(r){n.push.apply(n,e(r.querySelectorAll(t)))}),n}function E(e){var r=e.getPropertyValue("content");return/^["'].*["']$/.test(r)?r.slice(1,-1):""}function x(e){var r=g(e);return"button"===r||"input"===r&&"hidden"!==e.getAttribute("type")||"meter"===r||"output"===r||"progress"===r||"select"===r||"textarea"===r}function I(e){if(x(e))return e;var r=null;return e.childNodes.forEach(function(e){if(null===r&&n(e)){var t=I(e);null!==t&&(r=t)}}),r}function L(e){if(void 0!==e.control)return e.control;var r=e.getAttribute("for");return null!==r?e.ownerDocument.getElementById(r):I(e)}function A(I){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},w=new r,R=t(I),N=A.compute,S=void 0===N?"name":N,j=A.computedStyleSupportsPseudoElements,k=void 0===j?void 0!==A.getComputedStyle:j,C=A.getComputedStyle,P=void 0===C?R.getComputedStyle.bind(R):C,T=A.hidden,V=void 0!==T&&T;function q(r,t){var u,a,l="";if(n(r)&&k){var o=E(P(r,"::before"));l="".concat(o," ").concat(l)}if((p(r)?0===(a=(u=r).assignedNodes()).length?e(u.childNodes):a:e(r.childNodes).concat(i(r,"aria-owns"))).forEach(function(e){var r=B(e,{isEmbeddedInLabel:t.isEmbeddedInLabel,isReferenced:!1,recursion:!0}),i="inline"!==(n(e)?P(e).getPropertyValue("display"):"inline")?" ":"";l+="".concat(i).concat(r).concat(i)}),n(r)&&k){var d=E(P(r,"::after"));l="".concat(l," ").concat(d)}return l.trim()}function D(e,r){var t=e.getAttributeNode(r);return null===t||w.has(t)||""===t.value.trim()?null:(w.add(t),t.value)}function O(r){if(!n(r))return null;if(l(r)){w.add(r);for(var t=e(r.childNodes),i=0;i<t.length;i+=1){var m=t[i];if(o(m))return B(m,{isEmbeddedInLabel:!1,isReferenced:!1,recursion:!1})}}else if(d(r)){w.add(r);for(var v=e(r.childNodes),p=0;p<v.length;p+=1){var h=v[p];if(f(h))return B(h,{isEmbeddedInLabel:!1,isReferenced:!1,recursion:!1})}}else{if(c(r)){w.add(r);for(var y=e(r.childNodes),E=0;E<y.length;E+=1){var I=y[E];if(s(I))return I.textContent}return null}if("img"===g(r)||"area"===g(r)){var A=D(r,"alt");if(null!==A)return A}else if(b(r)){var R=D(r,"label");if(null!==R)return R}}if(a(r)&&("button"===r.type||"submit"===r.type||"reset"===r.type)){var N=D(r,"value");if(null!==N)return N;if("submit"===r.type)return"Submit";if("reset"===r.type)return"Reset"}var S=function(r){var t=r.labels;if(null===t)return t;if(void 0!==t)return e(t);if(!x(r))return null;var n=r.ownerDocument;return e(n.querySelectorAll("label")).filter(function(e){return L(e)===r})}(r);if(null!==S&&0!==S.length)return w.add(r),e(S).map(function(e){return B(e,{isEmbeddedInLabel:!0,isReferenced:!1,recursion:!0})}).filter(function(e){return e.length>0}).join(" ");if(a(r)&&"image"===r.type){var j=D(r,"alt");if(null!==j)return j;var k=D(r,"title");return null!==k?k:"Submit Query"}if(u(r,["button"])){var C=q(r,{isEmbeddedInLabel:!1});if(""!==C)return C}return null}function B(r,t){if(w.has(r))return"";if(!V&&function(e,r){if(!n(e))return!1;if(e.hasAttribute("hidden")||"true"===e.getAttribute("aria-hidden"))return!0;var t=r(e);return"none"===t.getPropertyValue("display")||"hidden"===t.getPropertyValue("visibility")}(r,P)&&!t.isReferenced)return w.add(r),"";var l=n(r)?r.getAttributeNode("aria-labelledby"):null,o=null===l||w.has(l)?[]:i(r,"aria-labelledby");if("name"===S&&!t.isReferenced&&o.length>0)return w.add(l),o.map(function(e){return B(e,{isEmbeddedInLabel:t.isEmbeddedInLabel,isReferenced:!0,recursion:!1})}).join(" ");var d,c,s,b=t.recursion&&(u(d=r,["button","combobox","listbox","textbox"])||h(d,"range"))&&"name"===S;if(!b){var p=(n(r)&&r.getAttribute("aria-label")||"").trim();if(""!==p&&"name"===S)return w.add(r),p;if(!function(e){return u(e,["none","presentation"])}(r)){var g=O(r);if(null!==g)return w.add(r),g}}if(u(r,["menu"]))return w.add(r),"";if(b||t.isEmbeddedInLabel||t.isReferenced){if(u(r,["combobox","listbox"])){w.add(r);var E=m(s=r)?s.selectedOptions||y(s,"[selected]"):y(s,'[aria-selected="true"]');return 0===E.length?a(r)?r.value:"":e(E).map(function(e){return B(e,{isEmbeddedInLabel:t.isEmbeddedInLabel,isReferenced:!1,recursion:!0})}).join(" ")}if(h(r,"range"))return w.add(r),r.hasAttribute("aria-valuetext")?r.getAttribute("aria-valuetext"):r.hasAttribute("aria-valuenow")?r.getAttribute("aria-valuenow"):r.getAttribute("value")||"";if(u(r,["textbox"]))return w.add(r),a(c=r)||v(c)?c.value:c.textContent||""}if(function(e){return u(e,["button","cell","checkbox","columnheader","gridcell","heading","label","legend","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","tooltip","treeitem"])}(r)||n(r)&&t.isReferenced||function(e){return f(e)}(r)){var x=q(r,{isEmbeddedInLabel:t.isEmbeddedInLabel});if(""!==x)return w.add(r),x}if(r.nodeType===r.TEXT_NODE)return w.add(r),r.textContent||"";if(t.recursion)return w.add(r),q(r,{isEmbeddedInLabel:t.isEmbeddedInLabel});var I=function(e){return n(e)?D(e,"title"):null}(r);return null!==I?(w.add(r),I):(w.add(r),"")}return B(I,{isEmbeddedInLabel:!1,isReferenced:"description"===S,recursion:!1}).trim().replace(/\s\s+/g," ")}export{A as computeTextAlternative};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{computeTextAlternative as r}from"./accessible-name-and-description.mjs";import{hasAnyConcreteRoles as e}from"./util.mjs";function i(i){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e(i,["caption","code","deletion","emphasis","generic","insertion","paragraph","presentation","strong","subscript","superscript"])?"":r(i,t)}export{i as computeAccessibleName};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){var a;return null!==(a=e.localName)&&void 0!==a?a:e.tagName.toLowerCase()}var a={article:"article",aside:"complementary",button:"button",datalist:"listbox",dd:"definition",details:"group",dialog:"dialog",dt:"term",fieldset:"group",figure:"figure",form:"form",footer:"contentinfo",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",header:"banner",hr:"separator",html:"document",legend:"legend",li:"listitem",math:"math",main:"main",menu:"list",nav:"navigation",ol:"list",optgroup:"group",option:"option",output:"status",progress:"progressbar",section:"region",summary:"button",table:"table",tbody:"rowgroup",textarea:"textbox",tfoot:"rowgroup",td:"cell",th:"columnheader",thead:"rowgroup",tr:"row",ul:"list"},r={caption:new Set(["aria-label","aria-labelledby"]),code:new Set(["aria-label","aria-labelledby"]),deletion:new Set(["aria-label","aria-labelledby"]),emphasis:new Set(["aria-label","aria-labelledby"]),generic:new Set(["aria-label","aria-labelledby","aria-roledescription"]),insertion:new Set(["aria-label","aria-labelledby"]),paragraph:new Set(["aria-label","aria-labelledby"]),presentation:new Set(["aria-label","aria-labelledby"]),strong:new Set(["aria-label","aria-labelledby"]),subscript:new Set(["aria-label","aria-labelledby"]),superscript:new Set(["aria-label","aria-labelledby"])};function t(e,a){return function(e,a){return["aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-details","aria-dropeffect","aria-flowto","aria-grabbed","aria-hidden","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-owns","aria-relevant","aria-roledescription"].some(function(t){var i;return e.hasAttribute(t)&&!(null!==(i=r[a])&&void 0!==i&&i.has(t))})}(e,a)}function i(r){var i=function(e){var a=e.getAttribute("role");if(null!==a){var r=a.trim().split(" ")[0];if(r.length>0)return r}return null}(r);if(null===i||"presentation"===i){var l=function(r){var i=a[e(r)];if(void 0!==i)return i;switch(e(r)){case"a":case"area":case"link":if(r.hasAttribute("href"))return"link";break;case"img":return""!==r.getAttribute("alt")||t(r,"img")?"img":"presentation";case"input":var l=r.type;switch(l){case"button":case"image":case"reset":case"submit":return"button";case"checkbox":case"radio":return l;case"range":return"slider";case"email":case"tel":case"text":case"url":return r.hasAttribute("list")?"combobox":"textbox";case"search":return r.hasAttribute("list")?"combobox":"searchbox";case"number":return"spinbutton";default:return null}case"select":return r.hasAttribute("multiple")||r.size>1?"listbox":"combobox"}return null}(r);if("presentation"!==i||t(r,l||""))return l}return i}export{i as default,e as getLocalName};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e,i){return e&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,n(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function n(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,n);if("object"!==t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===t(n)?n:String(n)}var i="undefined"==typeof Set?Set:function(){function t(){var e,i,r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=void 0,(i=n(i="items"))in e?Object.defineProperty(e,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[i]=r,this.items=o}return e(t,[{key:"add",value:function(t){return!1===this.has(t)&&this.items.push(t),this}},{key:"clear",value:function(){this.items=[]}},{key:"delete",value:function(t){var e=this.items.length;return this.items=this.items.filter(function(e){return e!==t}),e!==this.items.length}},{key:"forEach",value:function(t){var e=this;this.items.forEach(function(n){t(n,n,e)})}},{key:"has",value:function(t){return-1!==this.items.indexOf(t)}},{key:"size",get:function(){return this.items.length}}]),t}();export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r=Object.prototype.toString;var t=Math.pow(2,53)-1;function n(r){var n=function(r){var t=Number(r);return isNaN(t)?0:0!==t&&isFinite(t)?(t>0?1:-1)*Math.floor(Math.abs(t)):t}(r);return Math.min(Math.max(n,0),t)}function e(t,e){var a=Array,o=Object(t);if(null==t)throw new TypeError("Array.from requires an array-like object - not null or undefined");for(var i,u,c=n(o.length),f="function"==typeof(i=a)||"[object Function]"===r.call(i)?Object(new a(c)):new Array(c),l=0;l<c;)u=o[l],f[l]=u,l+=1;return f.length=c,f}export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n,{getLocalName as t}from"./getRole.mjs";function e(n){return null!==n&&n.nodeType===n.ELEMENT_NODE}function r(n){return e(n)&&"caption"===t(n)}function u(n){return e(n)&&"input"===t(n)}function o(n){return e(n)&&"optgroup"===t(n)}function i(n){return e(n)&&"select"===t(n)}function f(n){return e(n)&&"table"===t(n)}function c(n){return e(n)&&"textarea"===t(n)}function l(n){var t=(null===n.ownerDocument?n:n.ownerDocument).defaultView;if(null===t)throw new TypeError("no window available");return t}function a(n){return e(n)&&"fieldset"===t(n)}function d(n){return e(n)&&"legend"===t(n)}function p(n){return e(n)&&"slot"===t(n)}function m(n){return e(n)&&void 0!==n.ownerSVGElement}function w(n){return e(n)&&"svg"===t(n)}function g(n){return m(n)&&"title"===t(n)}function s(n,t){if(e(n)&&n.hasAttribute(t)){var r=n.getAttribute(t).split(" "),u=n.getRootNode?n.getRootNode():n.ownerDocument;return r.map(function(n){return u.getElementById(n)}).filter(function(n){return null!==n})}return[]}function E(t,r){return!!e(t)&&-1!==r.indexOf(n(t))}export{t as getLocalName,E as hasAnyConcreteRoles,e as isElement,a as isHTMLFieldSetElement,u as isHTMLInputElement,d as isHTMLLegendElement,o as isHTMLOptGroupElement,i as isHTMLSelectElement,p as isHTMLSlotElement,r as isHTMLTableCaptionElement,f as isHTMLTableElement,c as isHTMLTextAreaElement,m as isSVGElement,w as isSVGSVGElement,g as isSVGTitleElement,s as queryIdRefs,l as safeWindow};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{TestDefaultNodeComponent,createNestedTestDocument,createTestDocument,defaultTestComponentFactory,renderWithSduiLayout}from"./utils/dev-utils.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{render as r}from"../../../node_modules/.pnpm/@testing-library_react@16.3.1_@testing-library_dom@10.4.1_@types_react-dom@18.3.7_@types_reac_bxcobvx7qxffu3uqpqwx2mjx3m/node_modules/@testing-library/react/dist/@testing-library/react.esm.mjs";import{SduiLayoutRendererInner as o}from"../../react-wrapper/components/SduiLayoutRenderer.mjs";import{SduiLayoutProvider as n}from"../../react-wrapper/context/SduiLayoutContext.mjs";import{useRenderNode as d}from"../../react-wrapper/hooks/useRenderNode.mjs";import{useSduiNodeSubscription as i}from"../../react-wrapper/hooks/useSduiNodeSubscription.mjs";import{SduiLayoutStore as a}from"../../store/SduiLayoutStore.mjs";const s=({nodeId:r,parentPath:o=[]})=>{const{type:n,childrenIds:a}=i({nodeId:r}),{renderNode:s,currentPath:c}=d({nodeId:r,parentPath:o});return n?t("div",{"data-sdui-node-id":r,"data-sdui-node-type":n,children:[t("div",{children:["Type: ",n]}),t("div",{children:["ID: ",r]}),a&&a.length>0&&e("div",{children:a.map(t=>e("div",{children:s(t,c)},t))})]}):null},c=(t,r)=>e(s,{nodeId:t,parentPath:r});function m(e){const t={id:"root",type:"Container",children:[]},r=(null==e?void 0:e.root)?Object.assign(Object.assign({},t),e.root):t;return Object.assign(Object.assign({version:"1.0.0",metadata:{id:"test-doc",name:"Test Document"}},e),{root:r})}function p(){return{version:"1.0.0",metadata:{id:"nested-doc",name:"Nested Document"},root:{id:"root",type:"Container",children:[{id:"child-1",type:"Card",children:[{id:"grandchild-1",type:"Panel"}]},{id:"child-2",type:"Card"}]}}}function u(d,i,s){var c;const{components:m,componentOverrides:p,onError:u}=i||{},l={componentOverrides:Object.assign(Object.assign({},m),p)},h=new a(void 0,l);try{h.updateLayout(d)}catch(e){u&&u(e instanceof Error?e:new Error(String(e)))}const y=m||{},v=null===(c=null==d?void 0:d.root)||void 0===c?void 0:c.id;return r(v?t(n,{store:h,children:[e(o,{id:v,componentMap:y}),s]}):e("div",{children:"Invalid document: missing root.id"}))}export{s as TestDefaultNodeComponent,p as createNestedTestDocument,m as createTestDocument,c as defaultTestComponentFactory,u as renderWithSduiLayout};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsxs as e}from"react/jsx-runtime";import{useSduiNodeSubscription as d}from"../react-wrapper/hooks/useSduiNodeSubscription.mjs";const o=({nodeId:o,parentPath:t=[]})=>{const{type:r}=d({nodeId:o});return r?e("div",{"data-sdui-node-id":o,"data-sdui-node-type":r,children:[e("div",{children:["Type: ",r]}),e("div",{children:["ID: ",o]})]}):null};o.displayName="DefaultNodeComponent";export{o as DefaultNodeComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
const o={};export{o as componentMap};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{DefaultNodeComponent as t}from"./DefaultNodeComponent.mjs";const e=(e,r)=>o(t,{nodeId:e,parentPath:r});export{e as defaultComponentFactory};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SduiLayoutRenderer}from"./react-wrapper/components/SduiLayoutRenderer.mjs";export{SduiLayoutProvider}from"./react-wrapper/context/SduiLayoutContext.mjs";export{useRenderNode}from"./react-wrapper/hooks/useRenderNode.mjs";export{useSduiLayoutAction}from"./react-wrapper/hooks/useSduiLayoutAction.mjs";export{useSduiNodeSubscription}from"./react-wrapper/hooks/useSduiNodeSubscription.mjs";export{SduiLayoutStore}from"./store/SduiLayoutStore.mjs";export{denormalizeSduiLayout,denormalizeSduiNode}from"./utils/normalize/denormalize.mjs";export{normalizeSduiLayout,normalizeSduiNode}from"./utils/normalize/normalize.mjs";
|
|
1
|
+
export{SduiLayoutRenderer}from"./react-wrapper/components/SduiLayoutRenderer.mjs";export{SduiLayoutProvider}from"./react-wrapper/context/SduiLayoutContext.mjs";export{useRenderNode}from"./react-wrapper/hooks/useRenderNode.mjs";export{useSduiLayoutAction}from"./react-wrapper/hooks/useSduiLayoutAction.mjs";export{useSduiNodeReference}from"./react-wrapper/hooks/useSduiNodeReference.mjs";export{useSduiNodeSubscription}from"./react-wrapper/hooks/useSduiNodeSubscription.mjs";export{getNodeSubscriptionData}from"./react-wrapper/hooks/useSduiNodeSubscriptionSync.mjs";export{SduiLayoutStore}from"./store/SduiLayoutStore.mjs";export{buildCurrentPath,buildCurrentPathArray,formatParentPath}from"./utils/parentPath.mjs";export{denormalizeSduiLayout,denormalizeSduiNode}from"./utils/normalize/denormalize.mjs";export{normalizeSduiLayout,normalizeSduiNode}from"./utils/normalize/normalize.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import"react/jsx-runtime";import"react";import"lodash-es";import"../../utils/normalize/normalize.mjs";import"../../../_virtual/_tslib.mjs";import"../context/SduiLayoutContext.mjs";import{useRenderNode as o}from"../hooks/useRenderNode.mjs";const t=({id:t,componentMap:e})=>{const{renderNode:r}=o({nodeId:t,componentMap:e,parentPath:[]});return r(t,[])};export{t as SduiLayoutRendererInner};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{
|
|
2
|
+
import t,{useMemo as e,useCallback as n}from"react";import{defaultComponentFactory as r}from"../../components/defaultComponentFactory.mjs";import{buildCurrentPathArray as o,buildCurrentPath as m}from"../../utils/parentPath.mjs";import{useSduiLayoutContext as p}from"../context/SduiLayoutContext.mjs";const a=({nodeId:a,componentMap:s,parentPath:d=[]})=>{const{store:c}=p(),{nodes:i}=c.state,u=e(()=>o(d,a),[d,a]),l=e(()=>m(d,a),[d,a]),f=n((t,e=[])=>{const n=i[t];if(!n)return null;const o=c.getComponentOverrides(),m=s||{};return(o[t]||o[n.type]||m[n.type]||r)(t,e)},[i,c,s]),h=n(e=>e.map(e=>{const n=f(e,u);return t.isValidElement(n)?t.cloneElement(n,{key:e}):n}),[f,u]);return{renderNode:f,renderChildren:h,currentPath:u,pathString:l,nodeId:a,parentPath:d}};export{a as useRenderNode};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import e,{useMemo as r,useSyncExternalStore as n}from"react";import{useSduiLayoutAction as t}from"./useSduiLayoutAction.mjs";import{useSduiNodeSubscription as s}from"./useSduiNodeSubscription.mjs";function o(o){const{nodeId:d,schema:u}=o,{reference:c}=s({nodeId:d}),a=r(()=>c?Array.isArray(c)?c:[c]:[],[c]),i=function(s,o){const d=t(),u=e.useRef(null),c=e.useRef(null),a=n(e=>{const r=s.map(r=>d.subscribeNode(r,e)),n=d.subscribeVersion(e);return()=>{r.forEach(e=>e()),n()}},()=>{const e=d.getSnapshot(),r=s.map(r=>e[r]||"none"),n=s.join(",");return u.current&&u.current.nodeIdsKey===n&&u.current.values.length===r.length&&u.current.values.every((e,n)=>e===r[n])?u.current.values:(u.current={nodeIdsKey:n,values:r},r)},()=>{const e=s.join(",");if(c.current&&c.current.nodeIdsKey===e)return c.current.values;const r=d.getServerSnapshot(),n=s.map(e=>r[e]||"none");return c.current={nodeIdsKey:e,values:n},n}),{nodes:i}=d.state,l=r(()=>a.join(":"),[a]);return r(()=>s.map(e=>{const r=i[e],n=(null==r?void 0:r.childrenIds)||[],t=(null==r?void 0:r.state)||{},s=null==r?void 0:r.attributes,d=null==r?void 0:r.reference;let u;if(o){const r=o.safeParse(t);if(!r.success)throw new Error(`State validation failed for referenced node "${e}": ${r.error.message}`);u=r.data}else u=t;return{node:r,type:null==r?void 0:r.type,state:u,childrenIds:n,attributes:s,reference:d,exists:!!r}}),[s,i,o,l])}(a,u),{referencedNodes:l,referencedNodesMap:f}=r(()=>{const e=i.map((e,r)=>({id:a[r],node:e.node,type:e.type,state:e.state,attributes:e.attributes,exists:e.exists})),r={};return e.forEach(e=>{r[e.id]=e}),{referencedNodes:e,referencedNodesMap:r}},[i,a]);return{referencedNodes:l,referencedNodesMap:f,reference:c,hasReference:a.length>0}}export{o as useSduiNodeReference};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{
|
|
2
|
+
import{useSduiNodeSubscriptionSync as o}from"./useSduiNodeSubscriptionSync.mjs";function r(r){return o(r)}export{r as useSduiNodeSubscription};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import e,{useSyncExternalStore as r}from"react";import{useSduiLayoutAction as n}from"./useSduiLayoutAction.mjs";function t(e,r,n){var t;const{nodes:o}=e.state,s=o[r],u=null!==(t=null==s?void 0:s.childrenIds)&&void 0!==t?t:[],l=null==s?void 0:s.state,i=null==s?void 0:s.attributes,c=null==s?void 0:s.reference;let d;if(n)if(s&&void 0!==l){const e=n.safeParse(l);if(!e.success)throw new Error(`State validation failed for node "${r}": ${e.error.message}`);d=e.data}else d={};else d=null!=l?l:{};return{node:s,type:null==s?void 0:s.type,state:d,childrenIds:u,attributes:i,reference:c,exists:!!s}}const o="none";function s(s){const{nodeId:u,schema:l}=s,i=n();return function(n,t){const s=e.useRef(null),u=e.useRef(null);r(e=>{const r=n.subscribeNode(t,e),o=n.subscribeVersion(e);return()=>{r(),o()}},()=>{var e;const r=null!==(e=n.getSnapshot()[t])&&void 0!==e?e:o;return s.current===r?s.current:(s.current=r,r)},()=>{var e;return null===u.current&&(u.current=null!==(e=n.getServerSnapshot()[t])&&void 0!==e?e:o),u.current})}(i,u),t(i,u,l)}export{t as getNodeSubscriptionData,s as useSduiNodeSubscriptionSync};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cloneDeep as t}from"lodash-es";import{normalizeSduiLayout as e}from"../utils/normalize/normalize.mjs";import{MetadataNotFoundError as
|
|
1
|
+
import{cloneDeep as t}from"lodash-es";import{normalizeSduiLayout as e}from"../utils/normalize/normalize.mjs";import{MetadataNotFoundError as s,NodeNotFoundError as r,RootNotFoundError as i}from"./errors.mjs";import{DocumentManager as o}from"./managers/DocumentManager.mjs";import{LayoutStateRepository as a}from"./managers/LayoutStateRepository.mjs";import{SubscriptionManager as n}from"./managers/SubscriptionManager.mjs";import{VariablesManager as d}from"./managers/VariablesManager.mjs";class h{constructor(t,e){this._subscriptionManager=new n,this._repository=new a,this._documentManager=new o,this._componentOverrides={},this._repository.initializeState(t),this._variablesManager=new d(this._repository,this._subscriptionManager),this._componentOverrides=(null==e?void 0:e.componentOverrides)||{}}subscribeNode(t,e){return this._subscriptionManager.subscribeNode(t,e)}subscribeVersion(t){return this._subscriptionManager.subscribeVersion(t)}get state(){return this._repository.state}getSnapshot(){return this._repository.state.lastModified}getServerSnapshot(){return this.getSnapshot()}get nodes(){return this._repository.nodes}get metadata(){const t=this._documentManager.getMetadata();if(!t)throw new s;return t}getComponentOverrides(){return this._componentOverrides}getNodeById(t){const e=this._repository.getNodeById(t);if(!e)throw new r(t);return e}getNodeTypeById(t){const e=this._repository.getNodeTypeById(t);if(!e)throw new r(t);return e}getChildrenIdsById(t){if(!this._repository.getNodeById(t))throw new r(t);return this._repository.getChildrenIdsById(t)}getLayoutStateById(t){return this.getNodeById(t).state||{}}getAttributesById(t){return this.getNodeById(t).attributes||{}}getReferenceById(t){return this.getNodeById(t).reference}getRootId(){const t=this._repository.getRootId();if(!t)throw new i;return t}updateLayout(s){const{entities:r}=e(s);this._repository.updateNodes(r.nodes||{}),this._repository.setRootId(s.root.id),this._repository.setEdited(!1),this._repository.updateVariables(s.variables?t(s.variables):{}),this._repository.incrementVersion(),this._documentManager.setMetadata(s.metadata),this._documentManager.cacheDocument(s),this._subscriptionManager.notifyVersion()}mergeLayout(s){const{entities:r}=e(s),i=r.nodes||{},o=this._repository.mergeNodes(i),a=this._repository.state.selectedNodeId;a&&o.includes(a)&&this._repository.setSelectedNodeId(void 0),o.length>0&&this._subscriptionManager.cleanupNodes(o),this._repository.setRootId(s.root.id),this._repository.updateVariables(s.variables?t(s.variables):{}),this._repository.setEdited(!1),this._documentManager.setMetadata(s.metadata),this._documentManager.cacheDocument(s),this._repository.incrementVersion(),this._subscriptionManager.notifyVersion()}cancelEdit(t){const e=this._repository.getRootId(),s=t||(e?this._documentManager.getDocumentId(e):void 0);if(!s)return;const r=this._documentManager.getOriginalDocument(s);r&&this.updateLayout(r)}updateNodeState(t,e){const s=this.getNodeById(t);this._repository.updateNodeState(t,Object.assign(Object.assign({},s.state||{}),e)),this._repository.setEdited(!0),this._subscriptionManager.notifyNode(t)}updateNodeAttributes(t,e){const s=this.getNodeById(t);this._repository.updateNodeAttributes(t,Object.assign(Object.assign({},s.attributes||{}),e)),this._repository.setEdited(!0),this._subscriptionManager.notifyNode(t)}updateNodeReference(t,e){this.getNodeById(t),this._repository.updateNodeReference(t,e),this._repository.setEdited(!0),this._subscriptionManager.notifyNode(t)}updateVariables(t){this._variablesManager.updateVariables(t)}updateVariable(t,e){this._variablesManager.updateVariable(t,e)}deleteVariable(t){this._variablesManager.deleteVariable(t)}setSelectedNodeId(t){const e=this._repository.setSelectedNodeId(t);e&&this._subscriptionManager.notifyNode(e),t&&this._subscriptionManager.notifyNode(t)}getDocument(){return this._documentManager.getDocument(this._repository)}reset(){this._documentManager.reset(),this._repository.reset(),this._subscriptionManager.notifyVersion()}resetToInitial(){const t=this._repository.getRootId();if(!t)throw new Error("Root ID is not available. Cannot reset to initial state.");const e=this._documentManager.getDocumentId(t);if(!e)throw new Error("Document ID is not available. Cannot reset to initial state.");const s=this._documentManager.getOriginalDocument(e);if(!s)throw new Error("Initial document is not available. Cannot reset to initial state.");this.updateLayout(s)}}export{h as SduiLayoutStore};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
class
|
|
1
|
+
import{__rest as t}from"../../../_virtual/_tslib.mjs";class e{constructor(){this._state={version:0,rootId:void 0,nodes:{},selectedNodeId:void 0,isEdited:!1,variables:{},lastModified:{}}}get state(){return this._state}get nodes(){return this._state.nodes}getNodeById(t){return this._state.nodes[t]}getNodeTypeById(t){var e;return null===(e=this._state.nodes[t])||void 0===e?void 0:e.type}getChildrenIdsById(t){var e;return(null===(e=this._state.nodes[t])||void 0===e?void 0:e.childrenIds)||[]}getRootId(){return this._state.rootId}getLastModified(t){return this._state.lastModified[t]}initializeState(t){this._state=Object.assign({version:0,rootId:void 0,nodes:{},selectedNodeId:void 0,isEdited:!1,variables:{},lastModified:{}},t)}updateNodes(t){this._state.nodes=t;const e=(new Date).toISOString(),s={};Object.keys(t).forEach(t=>{s[t]=e}),this._state.lastModified=s}deleteNode(e){const s=this._state.nodes,i=e;s[i];const d=t(s,["symbol"==typeof i?i:i+""]);this._state.nodes=d;const a=this._state.lastModified,o=e;a[o];const n=t(a,["symbol"==typeof o?o:o+""]);this._state.lastModified=n}deleteNodes(t){if(0===t.length)return;const e={},s=new Set(t);Object.keys(this._state.nodes).forEach(t=>{s.has(t)||(e[t]=this._state.nodes[t])}),this._state.nodes=e;const i={};Object.keys(this._state.lastModified).forEach(t=>{s.has(t)||(i[t]=this._state.lastModified[t])}),this._state.lastModified=i}mergeNodes(t){const e=new Set(Object.keys(this._state.nodes)),s=new Set(Object.keys(t)),i=[...e].filter(t=>!s.has(t)),d=(new Date).toISOString(),a={},{lastModified:o}=this._state,n=Object.assign({},o),r=new Set;return Object.keys(t).forEach(e=>{const s=this._state.nodes[e],i=t[e],{parentId:o}=i;s?a[e]=Object.assign(Object.assign({},i),{state:s.state||i.state||{}}):(a[e]=i,n[e]=d),o&&r.add(o)}),r.forEach(t=>{(a[t]||this._state.nodes[t])&&(n[t]=d)}),this._state.nodes=a,this._state.lastModified=n,i}updateNodeState(t,e){const s=this._state.nodes[t];s&&(this._state.nodes[t]=Object.assign(Object.assign({},s),{state:e}),this._state.lastModified=Object.assign(Object.assign({},this._state.lastModified),{[t]:(new Date).toISOString()}))}updateNodeAttributes(t,e){const s=this._state.nodes[t];s&&(this._state.nodes[t]=Object.assign(Object.assign({},s),{attributes:e}),this._state.lastModified=Object.assign(Object.assign({},this._state.lastModified),{[t]:(new Date).toISOString()}))}updateNodeReference(t,e){const s=this._state.nodes[t];s&&(this._state.nodes[t]=Object.assign(Object.assign({},s),{reference:e}),this._state.lastModified=Object.assign(Object.assign({},this._state.lastModified),{[t]:(new Date).toISOString()}))}setRootId(t){this._state.rootId=t}setSelectedNodeId(t){const e=this._state.selectedNodeId;return this._state.selectedNodeId=t,e}setEdited(t){this._state.isEdited=t}updateVariables(t){this._state.variables=t}incrementVersion(){this._state.version+=1}reset(){this._state.nodes={},this._state.rootId=void 0,this._state.isEdited=!1,this._state.selectedNodeId=void 0,this._state.variables={},this._state.lastModified={},this._state.version+=1}}export{e as LayoutStateRepository};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
class e{constructor(){this._nodeListeners=new Map,this._versionListeners=new Set}subscribeNode(e,s){return this._nodeListeners.has(e)||this._nodeListeners.set(e,new Set),this._nodeListeners.get(e).add(s),()=>{var t,i;null===(t=this._nodeListeners.get(e))||void 0===t||t.delete(s),0===(null===(i=this._nodeListeners.get(e))||void 0===i?void 0:i.size)&&this._nodeListeners.delete(e)}}subscribeVersion(e){return this._versionListeners.add(e),()=>{this._versionListeners.delete(e)}}notifyNode(e){var s;null===(s=this._nodeListeners.get(e))||void 0===s||s.forEach(e=>e())}notifyNodes(e){[...new Set(e)].forEach(e=>this.notifyNode(e))}notifyVersion(){this._versionListeners.forEach(e=>e())}}export{e as SubscriptionManager};
|
|
1
|
+
class e{constructor(){this._nodeListeners=new Map,this._versionListeners=new Set}subscribeNode(e,s){return this._nodeListeners.has(e)||this._nodeListeners.set(e,new Set),this._nodeListeners.get(e).add(s),()=>{var t,i;null===(t=this._nodeListeners.get(e))||void 0===t||t.delete(s),0===(null===(i=this._nodeListeners.get(e))||void 0===i?void 0:i.size)&&this._nodeListeners.delete(e)}}subscribeVersion(e){return this._versionListeners.add(e),()=>{this._versionListeners.delete(e)}}notifyNode(e){var s;null===(s=this._nodeListeners.get(e))||void 0===s||s.forEach(e=>e())}notifyNodes(e){[...new Set(e)].forEach(e=>this.notifyNode(e))}notifyVersion(){this._versionListeners.forEach(e=>e())}cleanupNode(e){this._nodeListeners.delete(e)}cleanupNodes(e){e.forEach(e=>{this._nodeListeners.delete(e)})}}export{e as SubscriptionManager};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function t
|
|
1
|
+
function e(t,n){var r;const i=null===(r=n.nodes)||void 0===r?void 0:r[t];if(!i)return null;const s=[];i.childrenIds&&s.push(...i.childrenIds);const c=s.map(t=>e(t,n)).filter(e=>null!==e);return Object.assign(Object.assign({id:i.id,type:i.type,state:i.state||{},attributes:i.attributes||{}},void 0!==i.reference&&{reference:i.reference}),c.length>0&&{children:c})}export{e as denormalizeSduiNode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{schema as
|
|
1
|
+
import{schema as e,normalize as t}from"normalizr";const i=new e.Entity("nodes",{},{idAttribute:"id",processStrategy:e=>Object.assign({id:e.id,type:e.type,state:e.state||{},attributes:e.attributes||{}},void 0!==e.reference&&{reference:e.reference})});function n(e){const n=e.children||[],s=n.length>0?t(n,[i]):{entities:{nodes:{}}},r=Object.assign({id:e.id,type:e.type,state:e.state||{},attributes:e.attributes||{}},void 0!==e.reference&&{reference:e.reference}),d=t(r,i),c={nodes:Object.assign(Object.assign({},d.entities.nodes),s.entities.nodes)},o=(e,t)=>{var i,n;c.nodes&&c.nodes[e.id]?c.nodes[e.id]=Object.assign(Object.assign({},c.nodes[e.id]),{childrenIds:(null===(i=e.children)||void 0===i?void 0:i.map(e=>e.id))||[],parentId:t}):c.nodes&&(c.nodes[e.id]=Object.assign(Object.assign({id:e.id,type:e.type,state:e.state||{},attributes:e.attributes||{}},void 0!==e.reference&&{reference:e.reference}),{childrenIds:(null===(n=e.children)||void 0===n?void 0:n.map(e=>e.id))||[],parentId:t})),e.children&&e.children.forEach(t=>o(t,e.id))};return o(e,void 0),{result:d.result,entities:c}}function s(e){const{result:t,entities:i}=n(e.root);return{result:t,entities:i}}i.define({children:[i]});export{s as normalizeSduiLayout,n as normalizeSduiNode};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(n,r=" > "){return n.join(r)}function r(n,r){return[...n,r]}function t(t,u,o=" > "){return n(r(t,u),o)}export{t as buildCurrentPath,r as buildCurrentPathArray,n as formatParentPath};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Utilities
|
|
3
|
+
*
|
|
4
|
+
* Helper functions and fixtures for testing
|
|
5
|
+
*/
|
|
6
|
+
import { RenderResult } from '@testing-library/react';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { ComponentFactory, SduiComponentProps } from '../../components/types';
|
|
9
|
+
import type { SduiLayoutDocument } from '../../schema';
|
|
10
|
+
import type { SduiLayoutStoreOptions } from '../../store/types';
|
|
11
|
+
/**
|
|
12
|
+
* Default node component for tests (includes child rendering).
|
|
13
|
+
*
|
|
14
|
+
* Displays node info and renders child nodes.
|
|
15
|
+
* Used as the default component in tests.
|
|
16
|
+
*/
|
|
17
|
+
export declare const TestDefaultNodeComponent: React.FC<SduiComponentProps>;
|
|
18
|
+
/**
|
|
19
|
+
* Default component factory for tests.
|
|
20
|
+
*
|
|
21
|
+
* Factory used as the default component in tests.
|
|
22
|
+
*/
|
|
23
|
+
export declare const defaultTestComponentFactory: ComponentFactory;
|
|
24
|
+
/**
|
|
25
|
+
* Create a test document with a single root node
|
|
26
|
+
*/
|
|
27
|
+
export declare function createTestDocument(overrides?: Partial<SduiLayoutDocument>): SduiLayoutDocument;
|
|
28
|
+
/**
|
|
29
|
+
* Create a test document with nested children
|
|
30
|
+
*/
|
|
31
|
+
export declare function createNestedTestDocument(): SduiLayoutDocument;
|
|
32
|
+
/**
|
|
33
|
+
* Render SDUI Layout with test components
|
|
34
|
+
*
|
|
35
|
+
* This helper function creates a store from a document and renders
|
|
36
|
+
* both the SDUI layout and additional test components together.
|
|
37
|
+
* Useful for testing store interactions while verifying SDUI rendering.
|
|
38
|
+
*
|
|
39
|
+
* @param document - SDUI Layout Document
|
|
40
|
+
* @param options - Optional store options and component map
|
|
41
|
+
* @param children - Additional test components to render alongside SDUI
|
|
42
|
+
* @returns Render result with both SDUI and test components
|
|
43
|
+
*/
|
|
44
|
+
export declare function renderWithSduiLayout(document: SduiLayoutDocument, options?: {
|
|
45
|
+
components?: Record<string, ComponentFactory>;
|
|
46
|
+
componentOverrides?: SduiLayoutStoreOptions['componentOverrides'];
|
|
47
|
+
onError?: (error: Error) => void;
|
|
48
|
+
}, children?: React.ReactNode): RenderResult;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default node component.
|
|
3
|
+
*
|
|
4
|
+
* Used when a node type is not mapped.
|
|
5
|
+
* Displays node information in the development environment.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { SduiComponentProps } from './types';
|
|
9
|
+
/**
|
|
10
|
+
* Default node component.
|
|
11
|
+
*
|
|
12
|
+
* Used when a node type is not mapped.
|
|
13
|
+
* Displays node information in the development environment.
|
|
14
|
+
*/
|
|
15
|
+
export declare const DefaultNodeComponent: React.FC<SduiComponentProps>;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import type { ComponentFactory } from './types';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
2
|
+
* SDUI Component Map
|
|
3
|
+
*
|
|
4
|
+
* Defines component mappings by node type.
|
|
5
|
+
* Render Props Pattern: inject renderNode from the parent to render children.
|
|
4
6
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* The default componentMap is empty. Consumers must provide their components
|
|
9
|
+
* via the components prop.
|
|
7
10
|
*/
|
|
8
|
-
|
|
11
|
+
import type { ComponentFactory } from './types';
|
|
9
12
|
/**
|
|
10
|
-
*
|
|
13
|
+
* Component map.
|
|
11
14
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
15
|
+
* Maps component factories by node type.
|
|
16
|
+
* Empty by default; consumers provide components via the components prop.
|
|
14
17
|
*/
|
|
15
|
-
export declare const
|
|
18
|
+
export declare const componentMap: Record<string, ComponentFactory>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default component factory.
|
|
3
|
+
*
|
|
4
|
+
* Used when a node type is not present in the componentMap.
|
|
5
|
+
* Displays node info and renders children.
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentFactory } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Default component factory.
|
|
10
|
+
*
|
|
11
|
+
* Used when a node type is not present in the componentMap.
|
|
12
|
+
* Displays node info and renders children.
|
|
13
|
+
*/
|
|
14
|
+
export declare const defaultComponentFactory: ComponentFactory;
|
|
@@ -1,18 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Server-Driven UI - Component System Types
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Component factory and render function type definitions
|
|
5
5
|
*/
|
|
6
|
-
import type { ReactNode } from
|
|
6
|
+
import type { ReactNode } from 'react';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Parent node ID path type
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* Parent node ID path for debugging.
|
|
11
|
+
* Example: ['root', 'container-1', 'button-1']
|
|
11
12
|
*/
|
|
12
|
-
export type
|
|
13
|
+
export type ParentPath = string[];
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
+
* Common props type for SDUI components
|
|
15
16
|
*
|
|
16
|
-
*
|
|
17
|
+
* Props shared across all SDUI components.
|
|
18
|
+
* Used when ComponentFactory passes props to components.
|
|
17
19
|
*/
|
|
18
|
-
export
|
|
20
|
+
export interface SduiComponentProps {
|
|
21
|
+
/** Node ID */
|
|
22
|
+
nodeId: string;
|
|
23
|
+
/** Parent node ID path for debugging */
|
|
24
|
+
parentPath?: ParentPath;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Child node rendering function type (Render Props)
|
|
28
|
+
*
|
|
29
|
+
* Injected from the parent and used to render child nodes.
|
|
30
|
+
* parentPath is the parent node ID path for debugging.
|
|
31
|
+
*/
|
|
32
|
+
export type RenderNodeFn = (childId: string, parentPath?: ParentPath) => ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Component factory type
|
|
35
|
+
*
|
|
36
|
+
* Renders a component given id and parentPath.
|
|
37
|
+
* parentPath is the parent node ID path for debugging (e.g., ['root', 'container-1']).
|
|
38
|
+
* Components can render child nodes using the useRenderNode hook.
|
|
39
|
+
*/
|
|
40
|
+
export type ComponentFactory = (id: string, parentPath?: ParentPath) => ReactNode;
|
|
@@ -28,11 +28,13 @@
|
|
|
28
28
|
*/
|
|
29
29
|
export { SduiLayoutRenderer } from './react-wrapper/components/SduiLayoutRenderer';
|
|
30
30
|
export { SduiLayoutProvider } from './react-wrapper/context/SduiLayoutContext';
|
|
31
|
-
export { useRenderNode, useSduiLayoutAction, useSduiNodeSubscription } from './react-wrapper/hooks';
|
|
31
|
+
export { getNodeSubscriptionData, useRenderNode, useSduiLayoutAction, useSduiNodeReference, useSduiNodeSubscription, } from './react-wrapper/hooks';
|
|
32
32
|
export type { UseSduiNodeSubscriptionParams } from './react-wrapper/hooks/useSduiNodeSubscription';
|
|
33
|
+
export type { GetNodeSubscriptionDataReturn } from './react-wrapper/hooks/useSduiNodeSubscriptionSync';
|
|
33
34
|
export { SduiLayoutStore } from './store/SduiLayoutStore';
|
|
34
35
|
export type { SduiLayoutStoreOptions, SduiLayoutStoreState } from './store/types';
|
|
35
|
-
export type { SduiDocument, SduiLayoutDocument, SduiLayoutNode, SduiNode
|
|
36
|
-
export type { ComponentFactory, RenderNodeFn } from './components/types';
|
|
36
|
+
export type { SduiDocument, SduiLayoutDocument, SduiLayoutNode, SduiNode } from './schema';
|
|
37
|
+
export type { ComponentFactory, ParentPath, RenderNodeFn, SduiComponentProps } from './components/types';
|
|
38
|
+
export { buildCurrentPath, buildCurrentPathArray, formatParentPath } from './utils/parentPath';
|
|
37
39
|
export { denormalizeSduiLayout, denormalizeSduiNode, normalizeSduiLayout, normalizeSduiNode } from './utils/normalize';
|
|
38
40
|
export type { NormalizedSduiEntities } from './utils/normalize/types';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SDUI Layout Renderer
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* Render Props Pattern: renderNode
|
|
4
|
+
* Top-level component that renders the entire UI from an SDUI Layout Document.
|
|
5
|
+
* Render Props Pattern: defines the renderNode function and injects it into child components.
|
|
6
6
|
*
|
|
7
7
|
* @param document - SDUI Layout Document (required)
|
|
8
8
|
* @param components - Custom component map (optional, merged with defaults)
|
|
@@ -30,9 +30,9 @@ import type { SduiLayoutDocument } from '../../schema';
|
|
|
30
30
|
interface SduiLayoutRendererProps {
|
|
31
31
|
/** SDUI Layout Document */
|
|
32
32
|
document: SduiLayoutDocument;
|
|
33
|
-
/**
|
|
33
|
+
/** Custom component map (components added to componentMap) */
|
|
34
34
|
components?: Record<string, ComponentFactory>;
|
|
35
|
-
/**
|
|
35
|
+
/** One-time component override settings */
|
|
36
36
|
componentOverrides?: {
|
|
37
37
|
byNodeId?: Record<string, ComponentFactory>;
|
|
38
38
|
byNodeType?: Record<string, ComponentFactory>;
|
|
@@ -43,11 +43,11 @@ interface SduiLayoutRendererProps {
|
|
|
43
43
|
onError?: (error: Error) => void;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
* SduiLayoutRenderer
|
|
46
|
+
* SduiLayoutRenderer internal component.
|
|
47
47
|
*
|
|
48
|
-
* useRenderNode hook
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* Uses the useRenderNode hook to create the renderNode function and
|
|
49
|
+
* injects it into child components.
|
|
50
|
+
* Each component renders its children through this function.
|
|
51
51
|
*/
|
|
52
52
|
declare const SduiLayoutRendererInner: ({ id, componentMap: customComponentMap, }: {
|
|
53
53
|
id: string;
|
|
@@ -56,7 +56,7 @@ declare const SduiLayoutRendererInner: ({ id, componentMap: customComponentMap,
|
|
|
56
56
|
/**
|
|
57
57
|
* SduiLayoutRenderer
|
|
58
58
|
*
|
|
59
|
-
* SDUI Layout Document
|
|
59
|
+
* Top-level component that renders an SDUI Layout Document.
|
|
60
60
|
*/
|
|
61
61
|
export declare const SduiLayoutRenderer: React.FC<SduiLayoutRendererProps>;
|
|
62
62
|
export { SduiLayoutRendererInner };
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SDUI Layout Context
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Provides SduiLayoutStore via the Context API.
|
|
5
5
|
*/
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import type { SduiLayoutStore } from '../../store';
|
|
8
8
|
/**
|
|
9
|
-
* SduiLayoutContext
|
|
9
|
+
* SduiLayoutContext type
|
|
10
10
|
*/
|
|
11
11
|
interface SduiLayoutContextValue {
|
|
12
|
-
/** Store
|
|
12
|
+
/** Store instance */
|
|
13
13
|
store: SduiLayoutStore;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* SduiLayoutProvider Props
|
|
17
17
|
*/
|
|
18
18
|
interface SduiLayoutProviderProps {
|
|
19
|
-
/** Store
|
|
19
|
+
/** Store instance */
|
|
20
20
|
store: SduiLayoutStore;
|
|
21
|
-
/**
|
|
21
|
+
/** Child components */
|
|
22
22
|
children: React.ReactNode;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* SduiLayoutProvider
|
|
26
26
|
*
|
|
27
|
-
*
|
|
27
|
+
* Provides SduiLayoutStore via context.
|
|
28
28
|
*/
|
|
29
29
|
export declare const SduiLayoutProvider: React.FC<SduiLayoutProviderProps>;
|
|
30
30
|
/**
|
|
31
31
|
* useSduiLayoutContext
|
|
32
32
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
33
|
+
* Retrieves the store from context.
|
|
34
|
+
* Throws an error when used outside the provider.
|
|
35
35
|
*/
|
|
36
36
|
export declare const useSduiLayoutContext: () => SduiLayoutContextValue;
|
|
37
37
|
export {};
|
|
@@ -1,10 +1,51 @@
|
|
|
1
|
-
import type { ComponentFactory, RenderNodeFn } from '../../components/types';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
2
|
+
* SDUI Render Node Hook
|
|
4
3
|
*
|
|
5
|
-
*
|
|
4
|
+
* Hook that creates the renderNode function for the Render Props Pattern.
|
|
5
|
+
* Subscribes to node changes using useSyncExternalStore.
|
|
6
|
+
* Automatically computes and returns the current node info and currentPath.
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import type { ComponentFactory, ParentPath, RenderNodeFn } from '../../components/types';
|
|
10
|
+
/**
|
|
11
|
+
* useRenderNode hook parameter types
|
|
12
|
+
*/
|
|
13
|
+
export interface UseRenderNodeParams {
|
|
14
|
+
/** Current node ID */
|
|
15
|
+
nodeId: string;
|
|
16
|
+
/** Base component map (optional) */
|
|
17
|
+
componentMap?: Record<string, ComponentFactory>;
|
|
18
|
+
/** Parent node ID path (default: []) */
|
|
19
|
+
parentPath?: ParentPath;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* useRenderNode hook return types
|
|
23
|
+
*/
|
|
24
|
+
export interface UseRenderNodeReturn {
|
|
25
|
+
/** Function to render a child node */
|
|
26
|
+
renderNode: RenderNodeFn;
|
|
27
|
+
/** Function to convert child node IDs into a React children array */
|
|
28
|
+
renderChildren: (childrenIds: string[]) => React.ReactNode[];
|
|
29
|
+
/** Path array to the current node (auto-calculated) */
|
|
30
|
+
currentPath: ParentPath;
|
|
31
|
+
/** Path string to the current node (auto-calculated) */
|
|
32
|
+
pathString: string;
|
|
33
|
+
/** Current node ID */
|
|
34
|
+
nodeId: string;
|
|
35
|
+
/** Parent node ID path */
|
|
36
|
+
parentPath: ParentPath;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Hook that creates the renderNode function.
|
|
40
|
+
*
|
|
41
|
+
* Subscribes to node changes using useSyncExternalStore,
|
|
42
|
+
* and auto re-renders on changes.
|
|
43
|
+
* Automatically computes and returns current node info and currentPath.
|
|
6
44
|
*
|
|
7
|
-
* @param
|
|
8
|
-
* @
|
|
45
|
+
* @param params - Parameter object that includes node info
|
|
46
|
+
* @param params.nodeId - Current node ID
|
|
47
|
+
* @param params.componentMap - Base component map (optional)
|
|
48
|
+
* @param params.parentPath - Parent node ID path (default: [])
|
|
49
|
+
* @returns Object containing node info and rendering functions
|
|
9
50
|
*/
|
|
10
|
-
export declare const useRenderNode: (
|
|
51
|
+
export declare const useRenderNode: ({ nodeId, componentMap, parentPath }: UseRenderNodeParams) => UseRenderNodeReturn;
|