@exponential_app/eui-react 0.7.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -18,6 +18,8 @@ import {
18
18
  themeOrDefault,
19
19
  mediaMatches,
20
20
  parseMediaCondition,
21
+ readOnlyTemplates,
22
+ readOnlyTree,
21
23
  resolveMode,
22
24
  stringTable,
23
25
  templateBudget,
@@ -7515,6 +7517,7 @@ function ExponentialSurface({
7515
7517
  locale = DEFAULT_LOCALE,
7516
7518
  timeZone,
7517
7519
  strings: stringOverrides,
7520
+ readOnly = false,
7518
7521
  host,
7519
7522
  extensions: extensionsProp = EMPTY2,
7520
7523
  states = EMPTY2,
@@ -7569,9 +7572,9 @@ function ExponentialSurface({
7569
7572
  }, []);
7570
7573
  const lastTree = useRef26({ root: null, templates: NO_TEMPLATES });
7571
7574
  const rawRoot = surface ? surface.root : rootProp ?? null;
7572
- const root = useMemo19(() => lastTree.current.root = share(lastTree.current.root, rawRoot), [rawRoot]);
7575
+ const root = useMemo19(() => lastTree.current.root = share(lastTree.current.root, readOnly && rawRoot ? readOnlyTree(rawRoot) : rawRoot), [rawRoot, readOnly]);
7573
7576
  const rawTemplates = (surface ? surface.templates : templatesProp) ?? NO_TEMPLATES;
7574
- const templates = useMemo19(() => lastTree.current.templates = share(lastTree.current.templates, rawTemplates), [rawTemplates]);
7577
+ const templates = useMemo19(() => lastTree.current.templates = share(lastTree.current.templates, readOnly ? readOnlyTemplates(rawTemplates) : rawTemplates), [rawTemplates, readOnly]);
7575
7578
  const templateNode = useCallback11((componentId) => templates[componentId], [templates]);
7576
7579
  const templateRoots = useMemo19(() => Object.values(templates), [templates]);
7577
7580
  const lastBudget = useRef26(undefined);
@@ -8080,5 +8083,5 @@ export {
8080
8083
  walkNodes
8081
8084
  };
8082
8085
 
8083
- //# debugId=BC5D9945895E03F164756E2164756E21
8086
+ //# debugId=2E0A15CB61F62A4064756E2164756E21
8084
8087
  //# sourceMappingURL=index.js.map