@common-stack/components-pro 8.0.1-alpha.0 → 8.2.1-alpha.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.
Files changed (51) hide show
  1. package/LICENSE +34 -21
  2. package/lib/index.d.ts +3 -2
  3. package/lib/index.js +1 -1
  4. package/lib/index.native.d.ts +2 -1
  5. package/lib/index.native.js +1 -1
  6. package/lib/plugin/context.d.ts +7 -0
  7. package/lib/plugin/context.js +1 -0
  8. package/lib/plugin/context.js.map +1 -0
  9. package/lib/plugin/dynamic-render.d.ts +5 -0
  10. package/lib/plugin/dynamic-render.js +19 -0
  11. package/lib/plugin/dynamic-render.js.map +1 -0
  12. package/lib/plugin/index.d.ts +2 -0
  13. package/lib/plugin/index.native.d.ts +2 -0
  14. package/lib/plugin/loader.d.ts +7 -0
  15. package/lib/plugin/loader.js +20 -0
  16. package/lib/plugin/loader.js.map +1 -0
  17. package/lib/plugin/plugin-render.d.ts +13 -0
  18. package/lib/plugin/plugin-render.js +48 -0
  19. package/lib/plugin/plugin-render.js.map +1 -0
  20. package/lib/plugin/provider.d.ts +6 -0
  21. package/lib/plugin/provider.js +5 -0
  22. package/lib/plugin/provider.js.map +1 -0
  23. package/lib/plugin/provider.native.d.ts +7 -0
  24. package/lib/plugin/provider.native.js +3 -0
  25. package/lib/plugin/provider.native.js.map +1 -0
  26. package/lib/plugin/utils.server.d.ts +1 -0
  27. package/lib/slot-fill/__tests__/filler-slot.test.d.ts +1 -1
  28. package/lib/slot-fill/__tests__/slot-features.test.d.ts +1 -1
  29. package/lib/slot-fill/__tests__/slot-fill-provider.test.d.ts +1 -0
  30. package/lib/slot-fill/base/context.js +2 -1
  31. package/lib/slot-fill/base/context.js.map +1 -1
  32. package/lib/slot-fill/base/fill.js +18 -16
  33. package/lib/slot-fill/base/fill.js.map +1 -1
  34. package/lib/slot-fill/base/provider.d.ts +4 -21
  35. package/lib/slot-fill/base/provider.js +62 -84
  36. package/lib/slot-fill/base/provider.js.map +1 -1
  37. package/lib/slot-fill/base/slot.js +35 -37
  38. package/lib/slot-fill/base/slot.js.map +1 -1
  39. package/lib/slot-fill/index.js.map +1 -1
  40. package/lib/slot-fill/interfaces/index.d.ts +6 -0
  41. package/lib/slot-fill/utils/index.d.ts +7 -1
  42. package/lib/slot-fill/utils/index.js +9 -0
  43. package/lib/slot-fill/utils/index.js.map +1 -0
  44. package/lib/slot-fill/utils/isEmptyElement.d.ts +1 -1
  45. package/lib/slot-fill/utils/isEmptyElement.js +3 -0
  46. package/lib/slot-fill/utils/isEmptyElement.js.map +1 -1
  47. package/lib/slot-fill/utils/removeUniversalPortals.js.map +1 -1
  48. package/package.json +5 -5
  49. package/lib/slot-fill/utils/replaceServerFills.d.ts +0 -9
  50. package/lib/slot-fill/utils/replaceServerFills.js +0 -25
  51. package/lib/slot-fill/utils/replaceServerFills.js.map +0 -1
package/LICENSE CHANGED
@@ -1,21 +1,34 @@
1
- The MIT License
2
-
3
- Copyright (c) 2017 CDMBase LLC.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ PROPRIETARY LICENSE
2
+
3
+ Copyright (c) 2017-2025 CDMBase LLC. All Rights Reserved.
4
+
5
+ This software and associated documentation files (the "Software") are the
6
+ proprietary and confidential information of CDMBase LLC ("Confidential Information").
7
+
8
+ NOTICE: All information contained herein is, and remains the property of
9
+ CDMBase LLC. The intellectual and technical concepts contained herein are
10
+ proprietary to CDMBase LLC and may be covered by U.S. and Foreign Patents,
11
+ patents in process, and are protected by trade secret or copyright law.
12
+
13
+ Dissemination of this information or reproduction of this material is strictly
14
+ forbidden unless prior written permission is obtained from CDMBase LLC.
15
+
16
+ NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL
17
+ PROPERTY RIGHTS ARE GRANTED BY THIS DOCUMENT.
18
+
19
+ RESTRICTIONS:
20
+ 1. You may NOT use, copy, modify, merge, publish, distribute, sublicense,
21
+ and/or sell copies of the Software without explicit written permission
22
+ from CDMBase LLC.
23
+ 2. You may NOT reverse engineer, decompile, or disassemble the Software.
24
+ 3. You may NOT remove or alter any proprietary notices or labels on the Software.
25
+ 4. The Software is licensed, not sold.
26
+
27
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
30
+ CDMBASE LLC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
31
+ AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
32
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33
+
34
+ For licensing inquiries, please contact: legal@cdmbase.com
package/lib/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export { createSlotFill, Slot, Fill, Provider as SlotFillProvider, useSlot as __experimentalUseSlot } from './slot-fill';
2
- export { removeUniversalPortals, replaceServerFills } from './slot-fill/utils';
1
+ export { createSlotFill, Slot, Fill, Provider as SlotFillProvider, useSlot as __experimentalUseSlot, } from './slot-fill';
2
+ export { removeUniversalPortals } from './slot-fill/utils';
3
+ export * from './plugin';
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- export{Fill,Slot,Provider as SlotFillProvider,createSlotFill}from'./slot-fill/index.js';export{removeUniversalPortals}from'./slot-fill/utils/removeUniversalPortals.js';export{replaceServerFills}from'./slot-fill/utils/replaceServerFills.js';export{default as __experimentalUseSlot}from'./slot-fill/bubbles-virtually/use-slot.js';//# sourceMappingURL=index.js.map
1
+ export{Fill,Slot,Provider as SlotFillProvider,createSlotFill}from'./slot-fill/index.js';export{removeUniversalPortals}from'./slot-fill/utils/removeUniversalPortals.js';export{default as FillRenderProvider}from'./plugin/provider.js';export{PluginsLoader}from'./plugin/loader.js';export{default as __experimentalUseSlot}from'./slot-fill/bubbles-virtually/use-slot.js';//# sourceMappingURL=index.js.map
@@ -1 +1,2 @@
1
- export { createSlotFill, Slot, Fill, Provider as SlotFillProvider, } from './slot-fill';
1
+ export { createSlotFill, Slot, Fill, Provider as SlotFillProvider } from './slot-fill';
2
+ export * from './plugin/index.native';
@@ -1 +1 @@
1
- export{Fill,Slot,Provider as SlotFillProvider,createSlotFill}from'./slot-fill/index.js';//# sourceMappingURL=index.native.js.map
1
+ export{Fill,Slot,Provider as SlotFillProvider,createSlotFill}from'./slot-fill/index.js';export{default as FillRenderProvider}from'./plugin/provider.native.js';export{PluginsLoader}from'./plugin/loader.js';//# sourceMappingURL=index.native.js.map
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { ILoadedPlugin } from '../slot-fill/interfaces';
3
+ export interface IFillRenderContext {
4
+ loadedPlugins: ILoadedPlugin[];
5
+ }
6
+ declare const FillRenderContext: React.Context<IFillRenderContext>;
7
+ export default FillRenderContext;
@@ -0,0 +1 @@
1
+ import*as React from'react';const FillRenderContext = React.createContext(null);export{FillRenderContext as default};//# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sources":["../../src/plugin/context.tsx"],"sourcesContent":[null],"names":[],"mappings":"4BAOM,MAAA,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAA4B,IAAI"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare const DynamicRender: ({ renderImporter, ...props }: {
3
+ [x: string]: any;
4
+ renderImporter: any;
5
+ }) => React.JSX.Element;
@@ -0,0 +1,19 @@
1
+ import React__default,{useState,useEffect}from'react';const DynamicRender = ({ renderImporter, ...props }) => {
2
+ const [Component, setComponent] = useState(null);
3
+ useEffect(() => {
4
+ if (renderImporter) {
5
+ renderImporter()
6
+ .then((module) => {
7
+ const ImportedComponent = module.default;
8
+ setComponent(() => ImportedComponent);
9
+ })
10
+ .catch((error) => {
11
+ console.error(`Failed to load component from ${renderImporter}:`, error);
12
+ });
13
+ }
14
+ }, [renderImporter]);
15
+ if (!Component) {
16
+ return React__default.createElement(React__default.Fragment, null);
17
+ }
18
+ return React__default.createElement(Component, { ...props });
19
+ };export{DynamicRender};//# sourceMappingURL=dynamic-render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-render.js","sources":["../../src/plugin/dynamic-render.tsx"],"sourcesContent":[null],"names":["React"],"mappings":"sDAEO,MAAM,aAAa,GAAG,CAAC,EAAE,cAAc,EAAE,GAAG,KAAK,EAAE,KAAI;IAC1D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAkB,IAAI,CAAC,CAAC;IAElE,SAAS,CAAC,MAAK;QACX,IAAI,cAAc,EAAE;AAChB,YAAA,cAAc,EAAE;AACX,iBAAA,IAAI,CAAC,CAAC,MAAM,KAAI;AACb,gBAAA,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,CAAC;AACzC,gBAAA,YAAY,CAAC,MAAM,iBAAiB,CAAC,CAAC;AAC1C,aAAC,CAAC;AACD,iBAAA,KAAK,CAAC,CAAC,KAAK,KAAI;gBACb,OAAO,CAAC,KAAK,CAAC,CAAA,8BAAA,EAAiC,cAAc,CAAG,CAAA,CAAA,EAAE,KAAK,CAAC,CAAC;AAC7E,aAAC,CAAC,CAAC;SACV;AACL,KAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,IAAI,CAAC,SAAS,EAAE;AACZ,QAAA,OAAOA,2DAAK,CAAC;KAChB;AAED,IAAA,OAAOA,cAAC,CAAA,aAAA,CAAA,SAAS,EAAK,EAAA,GAAA,KAAK,GAAI,CAAC;AACpC"}
@@ -0,0 +1,2 @@
1
+ export { default as FillRenderProvider } from './provider';
2
+ export { PluginsLoader } from './loader';
@@ -0,0 +1,2 @@
1
+ export { default as FillRenderProvider } from './provider.native';
2
+ export { PluginsLoader } from './loader';
@@ -0,0 +1,7 @@
1
+ import { IAppLoadContext } from '@common-stack/client-core';
2
+ import { IResourceParams } from '@common-stack/core';
3
+ export declare function PluginsLoader(plugins: any[], loaderContext: {
4
+ request: Request;
5
+ context: IAppLoadContext;
6
+ params: IResourceParams;
7
+ }): Promise<any[]>;
@@ -0,0 +1,20 @@
1
+ async function PluginsLoader(plugins, loaderContext) {
2
+ const loadedPlugins = await Promise.all(plugins.map(async (plugin) => {
3
+ try {
4
+ if (plugin.renderImporter) {
5
+ const module = await plugin.renderImporter();
6
+ const ImportedComponent = module.default;
7
+ // if (module.loader && typeof module.loader === 'function') {
8
+ // const loaderData = await module.loader(loaderContext);
9
+ // return { ...plugin, Component: ImportedComponent, loaderData };
10
+ // }
11
+ return { ...plugin, Component: ImportedComponent };
12
+ }
13
+ }
14
+ catch (error) {
15
+ console.error('Error in PluginsLoader', error);
16
+ }
17
+ return plugin;
18
+ }));
19
+ return loadedPlugins;
20
+ }export{PluginsLoader};//# sourceMappingURL=loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.js","sources":["../../src/plugin/loader.ts"],"sourcesContent":[null],"names":[],"mappings":"AAGO,eAAe,aAAa,CAC/B,OAAc,EACd,aAAsF,EAAA;AAEtF,IAAA,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,GAAG,CACnC,OAAO,CAAC,GAAG,CAAC,OAAO,MAAW,KAAI;AAC9B,QAAA,IAAI;AACA,YAAA,IAAI,MAAM,CAAC,cAAc,EAAE;AACvB,gBAAA,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,EAAE,CAAC;AAC7C,gBAAA,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,CAAC;;;;;gBAMzC,OAAO,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;aACtD;SACJ;QAAC,OAAO,KAAK,EAAE;AACZ,YAAA,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;SAClD;AACD,QAAA,OAAO,MAAM,CAAC;KACjB,CAAC,CACL,CAAC;AACF,IAAA,OAAO,aAAa,CAAC;AACzB"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { ILoadedPlugin, Name } from '../slot-fill/interfaces';
3
+ interface IPluginRenderProps {
4
+ fills: ILoadedPlugin[];
5
+ name: Name;
6
+ [key: string]: any;
7
+ }
8
+ export declare const ChildrenRender: ({ children, ...props }: {
9
+ [x: string]: any;
10
+ children: any;
11
+ }) => React.JSX.Element;
12
+ export declare const PluginRender: (props: IPluginRenderProps) => React.JSX.Element;
13
+ export {};
@@ -0,0 +1,48 @@
1
+ import React__default,{useContext}from'react';import {DynamicRender}from'./dynamic-render.js';import {isFunction}from'../slot-fill/utils/index.js';import FillRenderContext from'./context.js';const ChildrenRender = ({ children, ...props }) => {
2
+ return React__default.createElement(React__default.Fragment, null, isFunction(children) ? children(props) : children);
3
+ };
4
+ const PluginRender = (props) => {
5
+ const context = useContext(FillRenderContext);
6
+ if (!context?.loadedPlugins) {
7
+ throw new Error('PluginRender must be used within a FillRenderContext.Provider');
8
+ }
9
+ const FillRender = ({ fill, ...props }) => {
10
+ const plugin = context.loadedPlugins.find((plugin) => plugin.index === fill.index);
11
+ const loaderData = plugin?.loaderData || {};
12
+ if (plugin?.Component) {
13
+ return React__default.createElement(plugin.Component, { ...props, loaderData: loaderData });
14
+ }
15
+ else if (fill.renderImporter) {
16
+ return React__default.createElement(DynamicRender, { ...props, renderImporter: fill.renderImporter, loaderData: loaderData });
17
+ }
18
+ else if (plugin?.render) {
19
+ let children = null;
20
+ try {
21
+ const FillComponent = plugin.render(props);
22
+ if (React__default.isValidElement(FillComponent)) {
23
+ const element = FillComponent;
24
+ children = element.props?.children;
25
+ }
26
+ }
27
+ catch (error) {
28
+ console.error('Error in PluginRender', error);
29
+ }
30
+ if (children) {
31
+ return React__default.createElement(ChildrenRender, { ...props, children: children });
32
+ }
33
+ }
34
+ else if (fill.children) {
35
+ return React__default.createElement(ChildrenRender, { ...props, children: fill.children });
36
+ }
37
+ return React__default.createElement(React__default.Fragment, null);
38
+ };
39
+ return (React__default.createElement(React__default.Fragment, null, props.fills.map((fill, i) => {
40
+ if (typeof window === 'undefined') {
41
+ return (React__default.createElement("div", { key: i, "data-slot-name": `slot-${props.name}` },
42
+ React__default.createElement(FillRender, { fill: fill, ...props })));
43
+ }
44
+ else {
45
+ return React__default.createElement(FillRender, { key: i, fill: fill, ...props });
46
+ }
47
+ })));
48
+ };export{ChildrenRender,PluginRender};//# sourceMappingURL=plugin-render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-render.js","sources":["../../src/plugin/plugin-render.tsx"],"sourcesContent":[null],"names":["React"],"mappings":"+LAiBO,MAAM,cAAc,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,KAAI;AACrD,IAAA,OAAOA,4DAAG,UAAU,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAI,CAAC;AACpE,EA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BAAA,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;aACjD;YACD,IAAI,QAAQ,EAAE;gBACV,OAAOA,cAAA,CAAA,aAAA,CAAC,cAAc,EAAK,EAAA,GAAA,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAA,CAAI,CAAC;aAC5D;SACJ;AAAM,aAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACtB,OAAOA,cAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAA,GAAK,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAA,CAAI,CAAC;SACjE;AACD,QAAA,OAAOA,2DAAK,CAAC;AACjB,KAAC,CAAC;AAEF,IAAA,QACIA,cAAA,CAAA,aAAA,CAAAA,cAAA,CAAA,QAAA,EAAA,IAAA,EACK,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAI;AACzB,QAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;YAC/B,QACIA,cAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,CAAC,oBAAkB,CAAQ,KAAA,EAAA,KAAK,CAAC,IAAI,CAAE,CAAA,EAAA;gBAC7CA,cAAC,CAAA,aAAA,CAAA,UAAU,EAAC,EAAA,IAAI,EAAE,IAAI,KAAM,KAAK,EAAA,CAAI,CACnC,EACR;SACL;aAAM;AACH,YAAA,OAAOA,cAAC,CAAA,aAAA,CAAA,UAAU,EAAC,EAAA,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAM,GAAA,KAAK,GAAI,CAAC;SACxD;KACJ,CAAC,CACH,EACL;AACN"}
@@ -0,0 +1,6 @@
1
+ import React, { ReactNode } from 'react';
2
+ interface FillRenderProviderProps {
3
+ children: ReactNode;
4
+ }
5
+ declare const FillRenderProvider: React.FC<FillRenderProviderProps>;
6
+ export default FillRenderProvider;
@@ -0,0 +1,5 @@
1
+ import React__default from'react';import {useLoaderData}from'@remix-run/react';import FillRenderContext from'./context.js';const FillRenderProvider = ({ children }) => {
2
+ const loaderData = useLoaderData();
3
+ const loadedPlugins = loaderData?.loadedPlugins || [];
4
+ return React__default.createElement(FillRenderContext.Provider, { value: { loadedPlugins } }, children);
5
+ };export{FillRenderProvider as default};//# sourceMappingURL=provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.js","sources":["../../src/plugin/provider.tsx"],"sourcesContent":[null],"names":["React"],"mappings":"2HAQA,MAAM,kBAAkB,GAAsC,CAAC,EAAE,QAAQ,EAAE,KAAI;AAC3E,IAAA,MAAM,UAAU,GAAQ,aAAa,EAAE,CAAC;AACxC,IAAA,MAAM,aAAa,GAAG,UAAU,EAAE,aAAa,IAAI,EAAE,CAAC;AAEtD,IAAA,OAAOA,cAAC,CAAA,aAAA,CAAA,iBAAiB,CAAC,QAAQ,EAAC,EAAA,KAAK,EAAE,EAAE,aAAa,EAAE,EAAG,EAAA,QAAQ,CAA8B,CAAC;AACzG"}
@@ -0,0 +1,7 @@
1
+ import React, { ReactNode } from 'react';
2
+ interface FillRenderProviderProps {
3
+ children: ReactNode;
4
+ loadedPlugins?: any[];
5
+ }
6
+ declare const FillRenderProvider: React.FC<FillRenderProviderProps>;
7
+ export default FillRenderProvider;
@@ -0,0 +1,3 @@
1
+ import React__default from'react';import FillRenderContext from'./context.js';const FillRenderProvider = ({ children, loadedPlugins = [] }) => {
2
+ return React__default.createElement(FillRenderContext.Provider, { value: { loadedPlugins } }, children);
3
+ };export{FillRenderProvider as default};//# sourceMappingURL=provider.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.native.js","sources":["../../src/plugin/provider.native.tsx"],"sourcesContent":[null],"names":["React"],"mappings":"8EAQM,MAAA,kBAAkB,GAAsC,CAAC,EAAE,QAAQ,EAAE,aAAa,GAAG,EAAE,EAAE,KAAI;AAC/F,IAAA,OAAOA,cAAC,CAAA,aAAA,CAAA,iBAAiB,CAAC,QAAQ,EAAC,EAAA,KAAK,EAAE,EAAE,aAAa,EAAE,EAAG,EAAA,QAAQ,CAA8B,CAAC;AACzG"}
@@ -0,0 +1 @@
1
+ export declare function resolveComponent(renderImporter: string): Promise<any>;
@@ -1 +1 @@
1
- import 'jest';
1
+ import '@testing-library/jest-dom';
@@ -1 +1 @@
1
- import 'jest';
1
+ import '@testing-library/jest-dom';
@@ -1,10 +1,11 @@
1
1
  import*as React from'react';const SlotFillContext = React.createContext({
2
+ // need to add default value otherwise it will fail
2
3
  registerSlot: () => { },
3
4
  unregisterSlot: () => { },
4
5
  registerFill: () => { },
5
6
  unregisterFill: () => { },
6
7
  getSlot: () => ({}),
7
- getFills: () => ([]),
8
+ getFills: () => [],
8
9
  hasFills: () => false,
9
10
  subscribe: () => { },
10
11
  });
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../src/slot-fill/base/context.tsx"],"sourcesContent":[null],"names":[],"mappings":"4BAGA,MAAM,eAAe,GAAG,KAAK,CAAC,aAAa,CAAkB;AAC3D,IAAA,YAAY,EAAE,MAAK,GAAG;AACtB,IAAA,cAAc,EAAE,MAAK,GAAG;AACxB,IAAA,YAAY,EAAE,MAAK,GAAG;AACtB,IAAA,cAAc,EAAE,MAAK,GAAG;AACxB,IAAA,OAAO,EAAE,OAAO,EAAE,CAAQ;AAC1B,IAAA,QAAQ,EAAE,OAAO,EAAE,CAAC;AACpB,IAAA,QAAQ,EAAE,MAAM,KAAK;AACrB,IAAA,SAAS,EAAE,MAAK,GAAG;AACpB,CAAA,EAAE;AACH,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG"}
1
+ {"version":3,"file":"context.js","sources":["../../../src/slot-fill/base/context.tsx"],"sourcesContent":[null],"names":[],"mappings":"4BAGA,MAAM,eAAe,GAAG,KAAK,CAAC,aAAa,CAAkB;;AAEzD,IAAA,YAAY,EAAE,MAAK,GAAG;AACtB,IAAA,cAAc,EAAE,MAAK,GAAG;AACxB,IAAA,YAAY,EAAE,MAAK,GAAG;AACtB,IAAA,cAAc,EAAE,MAAK,GAAG;AACxB,IAAA,OAAO,EAAE,OAAO,EAAE,CAAQ;AAC1B,IAAA,QAAQ,EAAE,MAAM,EAAE;AAClB,IAAA,QAAQ,EAAE,MAAM,KAAK;AACrB,IAAA,SAAS,EAAE,MAAK,GAAG;AACtB,CAAA,EAAE;AACH,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG"}
@@ -1,10 +1,11 @@
1
- import React__default,{useRef}from'react';import {createPortal}from'react-dom';import {Consumer}from'./context.js';import {useSlot}from'./use-slot.js';const FillComponent = ({ name, children, registerFill, unregisterFill, serverMode }) => {
1
+ import React__default,{useRef}from'react';import {Consumer}from'./context.js';import {useSlot}from'./use-slot.js';const FillComponent = ({ index, name, renderImporter, children, registerFill, unregisterFill, serverMode, }) => {
2
2
  const slot = useSlot(name);
3
3
  let useLayoutEffect;
4
+ const nodeProps = { index, renderImporter, children };
4
5
  if (serverMode) {
5
6
  useLayoutEffect = (args) => { };
6
- if (!!name && !!children) {
7
- registerFill(name, children);
7
+ if (!!name) {
8
+ registerFill(name, nodeProps);
8
9
  }
9
10
  return null;
10
11
  }
@@ -13,33 +14,33 @@ import React__default,{useRef}from'react';import {createPortal}from'react-dom';i
13
14
  }
14
15
  const ref = useRef({
15
16
  name,
16
- children,
17
+ nodeProps,
17
18
  });
18
19
  useLayoutEffect(() => {
19
20
  const refValue = ref.current;
20
- registerFill(name, refValue);
21
- return () => unregisterFill(name, refValue);
21
+ registerFill(name, refValue.nodeProps);
22
+ return () => unregisterFill(name, refValue.nodeProps);
22
23
  // Ignore reason: the useLayoutEffects here are written to fire at specific times, and introducing new dependencies could cause unexpected changes in behavior.
23
24
  // We'll leave them as-is until a more detailed investigation/refactor can be performed.
24
25
  // eslint-disable-next-line react-hooks/exhaustive-deps
25
26
  }, []);
26
27
  useLayoutEffect(() => {
27
- ref.current.children = children;
28
- if (slot) {
28
+ ref.current.nodeProps = nodeProps;
29
+ if (slot && typeof slot.forceUpdate === 'function') {
29
30
  slot.forceUpdate();
30
31
  }
31
32
  // Ignore reason: the useLayoutEffects here are written to fire at specific times, and introducing new dependencies could cause unexpected changes in behavior.
32
33
  // We'll leave them as-is until a more detailed investigation/refactor can be performed.
33
34
  // eslint-disable-next-line react-hooks/exhaustive-deps
34
- }, [children]);
35
+ }, [renderImporter, children]);
35
36
  useLayoutEffect(() => {
36
37
  if (name === ref.current.name) {
37
38
  // ignore initial effect
38
39
  return;
39
40
  }
40
- unregisterFill(ref.current.name, ref.current);
41
+ unregisterFill(ref.current.name, ref.current.nodeProps);
41
42
  ref.current.name = name;
42
- registerFill(name, ref.current);
43
+ registerFill(name, ref.current.nodeProps);
43
44
  // Ignore reason: the useLayoutEffects here are written to fire at specific times, and introducing new dependencies could cause unexpected changes in behavior.
44
45
  // We'll leave them as-is until a more detailed investigation/refactor can be performed.
45
46
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -48,12 +49,13 @@ import React__default,{useRef}from'react';import {createPortal}from'react-dom';i
48
49
  return null;
49
50
  }
50
51
  // If a function is passed as a child, provide it with the fillProps.
51
- if (typeof children === 'function') {
52
- children = children(slot.props.fillProps);
53
- }
54
- return createPortal(children, slot.node);
52
+ // if (typeof children === 'function') {
53
+ // children = children(slot.props.fillProps);
54
+ // }
55
+ // return createPortal(children, slot.node);
56
+ return React__default.createElement(React__default.Fragment, null);
55
57
  };
56
58
  const Fill = (props) => {
57
- const serverMode = (typeof window === 'undefined');
59
+ const serverMode = typeof window === 'undefined';
58
60
  return (React__default.createElement(Consumer, null, ({ registerFill, unregisterFill }) => (React__default.createElement(FillComponent, { ...props, registerFill: registerFill, unregisterFill: unregisterFill, serverMode: serverMode }))));
59
61
  };export{Fill as default};//# sourceMappingURL=fill.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fill.js","sources":["../../../src/slot-fill/base/fill.tsx"],"sourcesContent":[null],"names":["React"],"mappings":"uJASA,MAAM,aAAa,GAAG,CAAC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AI,CAAC,IAAI,EAAE;AACrB,QAAA,OAAO,IAAI,CAAC;KACf;;;;;;AAQD,IAAA,OAAOA,2DAAK,CAAC;AACjB,CAAC,CAAC;AAOF,MAAM,IAAI,GAAmB,CAAC,KAAK,KAAI;AACnC,IAAA,MAAM,UAAU,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC;AACjD,IAAA,QACIA,cAAA,CAAA,aAAA,CAAC,QAAQ,EAAA,IAAA,EACJ,CAAC,EAAE,YAAY,EAAE,cAAc,EAAE,MAC9BA,6BAAC,aAAa,EAAA,EAAA,GACN,KAAK,EACT,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EAAA,CACxB,CACL,CACM,EACb;AACN"}
@@ -1,24 +1,7 @@
1
- import React, { Component, ReactNode } from 'react';
2
- import { IFill, ISlot } from '../interfaces';
3
- declare class SlotFillProvider extends Component<{
1
+ import React, { ReactNode } from 'react';
2
+ interface SlotFillProviderProps {
4
3
  children: ReactNode;
5
- }, {}> {
6
- private slots;
7
- private fills;
8
- private listeners;
9
- private contextValue;
10
- private returnValue;
11
- constructor(props: any);
12
- registerSlot(name: any, slot: any): void;
13
- registerFill(name: any, instance: any): void;
14
- unregisterSlot(name: any, instance: any): void;
15
- unregisterFill(name: any, instance: IFill): void;
16
- getSlot(name: any): ISlot;
17
- getFills(name: any, slotInstance: any): IFill[];
18
- hasFills(name: any): boolean;
19
- private forceUpdateSlot;
20
- private triggerListeners;
21
- subscribe(listener: any): () => void;
22
- render(): React.JSX.Element;
4
+ context?: any;
23
5
  }
6
+ declare const SlotFillProvider: React.FC<SlotFillProviderProps>;
24
7
  export default SlotFillProvider;
@@ -1,100 +1,78 @@
1
- import React__default,{Component}from'react';import {sortBy}from'lodash-es';import {Provider}from'./context.js';class SlotFillProvider extends Component {
2
- slots;
3
- fills;
4
- listeners;
5
- contextValue;
6
- returnValue;
7
- constructor(props) {
8
- super(props);
9
- this.registerSlot = this.registerSlot.bind(this);
10
- this.registerFill = this.registerFill.bind(this);
11
- this.unregisterSlot = this.unregisterSlot.bind(this);
12
- this.unregisterFill = this.unregisterFill.bind(this);
13
- this.getSlot = this.getSlot.bind(this);
14
- this.getFills = this.getFills.bind(this);
15
- this.subscribe = this.subscribe.bind(this);
16
- this.slots = {};
17
- this.fills = {};
18
- this.listeners = [];
19
- this.contextValue = {
20
- registerSlot: this.registerSlot,
21
- unregisterSlot: this.unregisterSlot,
22
- registerFill: this.registerFill,
23
- unregisterFill: this.unregisterFill,
24
- getSlot: this.getSlot,
25
- getFills: this.getFills,
26
- hasFills: this.hasFills,
27
- subscribe: this.subscribe,
28
- };
29
- if (props.context) {
30
- this.returnValue = props.context;
31
- this.returnValue.fills = this.fills;
1
+ import React__default,{useRef,useCallback}from'react';import {sortBy}from'lodash-es';import {Provider}from'./context.js';const SlotFillProvider = ({ children, context }) => {
2
+ const slots = useRef({});
3
+ const fills = useRef({});
4
+ const listeners = useRef([]);
5
+ const returnValue = useRef(context);
6
+ const forceUpdateSlot = useCallback((name) => {
7
+ const slot = slots.current[name];
8
+ if (slot && typeof slot.forceUpdate === 'function') {
9
+ slot.forceUpdate();
32
10
  }
33
- }
34
- registerSlot(name, slot) {
35
- const previousSlot = this.slots[name];
36
- this.slots[name] = slot;
37
- this.triggerListeners();
11
+ }, []);
12
+ const triggerListeners = useCallback(() => {
13
+ listeners.current.forEach((listener) => listener());
14
+ }, []);
15
+ const registerSlot = useCallback((name, slot) => {
16
+ const previousSlot = slots.current[name];
17
+ slots.current[name] = slot;
18
+ triggerListeners();
38
19
  // Sometimes the fills are registered after the initial render of slot
39
20
  // But before the registerSlot call, we need to rerender the slot
40
- this.forceUpdateSlot(name);
21
+ forceUpdateSlot(name);
41
22
  // If a new instance of a slot is being mounted while another with the
42
23
  // same name exists, force its update _after_ the new slot has been
43
- // assigned into the instance, suich that its own rendering of children
24
+ // assigned into the instance, such that its own rendering of children
44
25
  // will be empty (the new Slot will subsume all fills for this name).
45
- if (previousSlot) {
26
+ if (previousSlot && typeof previousSlot.forceUpdate === 'function') {
46
27
  previousSlot.forceUpdate();
47
28
  }
48
- }
49
- registerFill(name, instance) {
50
- this.fills[name] = [...(this.fills[name] || []), instance];
51
- this.forceUpdateSlot(name);
52
- }
53
- unregisterSlot(name, instance) {
29
+ }, [forceUpdateSlot, triggerListeners]);
30
+ const registerFill = useCallback((name, instance) => {
31
+ fills.current[name] = [...(fills.current[name] || []), instance];
32
+ forceUpdateSlot(name);
33
+ }, [forceUpdateSlot]);
34
+ const unregisterSlot = useCallback((name, instance) => {
54
35
  // If a previous instance of a Slot by this name unmounts, do nothing,
55
36
  // as the slot and its fills should only be removed for the current
56
37
  // known instance.
57
- if (this.slots[name] !== instance) {
38
+ if (slots.current[name] !== instance) {
58
39
  return;
59
40
  }
60
- delete this.slots[name];
61
- this.triggerListeners();
62
- }
63
- unregisterFill(name, instance) {
64
- this.fills[name] = this.fills[name]?.filter((fill) => fill !== instance) ?? [];
65
- this.forceUpdateSlot(name);
66
- }
67
- getSlot(name) {
68
- return this.slots[name];
69
- }
70
- getFills(name, slotInstance) {
71
- // Commented following as we need the Slot to render at multiple places
72
- // Fills should only be returned for the current instance of the slot
73
- // in which they occupy.
74
- // if (this.slots[name] !== slotInstance) {
75
- // return [];
76
- // }
77
- return sortBy(this.fills[name]);
78
- }
79
- hasFills(name) {
80
- return this.fills[name] && !!this.fills[name].length;
81
- }
82
- forceUpdateSlot(name) {
83
- const slot = this.getSlot(name);
84
- if (slot) {
85
- slot.forceUpdate();
86
- }
87
- }
88
- triggerListeners() {
89
- this.listeners.forEach((listener) => listener());
90
- }
91
- subscribe(listener) {
92
- this.listeners.push(listener);
41
+ delete slots.current[name];
42
+ triggerListeners();
43
+ }, [triggerListeners]);
44
+ const unregisterFill = useCallback((name, instance) => {
45
+ fills.current[name] = fills.current[name]?.filter((fill) => fill !== instance) ?? [];
46
+ forceUpdateSlot(name);
47
+ }, [forceUpdateSlot]);
48
+ const getSlot = useCallback((name) => {
49
+ return slots.current[name];
50
+ }, []);
51
+ const getFills = useCallback((name, slotInstance) => {
52
+ return sortBy(fills.current[name]);
53
+ }, []);
54
+ const hasFills = useCallback((name) => {
55
+ return fills.current[name] && !!fills.current[name].length;
56
+ }, []);
57
+ const subscribe = useCallback((listener) => {
58
+ listeners.current.push(listener);
93
59
  return () => {
94
- this.listeners = this.listeners.filter((l) => l !== listener);
60
+ listeners.current = listeners.current.filter((l) => l !== listener);
95
61
  };
62
+ }, []);
63
+ const contextValue = {
64
+ registerSlot,
65
+ unregisterSlot,
66
+ registerFill,
67
+ unregisterFill,
68
+ getSlot,
69
+ getFills,
70
+ hasFills,
71
+ subscribe,
72
+ };
73
+ if (context) {
74
+ returnValue.current = context;
75
+ returnValue.current.fills = fills.current;
96
76
  }
97
- render() {
98
- return React__default.createElement(Provider, { value: this.contextValue }, this.props.children);
99
- }
100
- }export{SlotFillProvider as default};//# sourceMappingURL=provider.js.map
77
+ return React__default.createElement(Provider, { value: contextValue }, children);
78
+ };export{SlotFillProvider as default};//# sourceMappingURL=provider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sources":["../../../src/slot-fill/base/provider.tsx"],"sourcesContent":[null],"names":["React"],"mappings":"gHAKA,MAAM,gBAAiB,SAAQ,SAAsC,CAAA;AACzD,IAAA,KAAK,CAA2B;AAChC,IAAA,KAAK,CAA6B;AAClC,IAAA,SAAS,CAAC;AACV,IAAA,YAAY,CAAiB;AAC7B,IAAA,WAAW,CAAC;AACpB,IAAA,WAAA,CAAY,KAAK,EAAA;QACb,KAAK,CAAC,KAAK,CAAC,CAAC;QAEb,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC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AK;AACR,YAAA,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,CAAC;AACxE,SAAC,CAAC;KACL,EAAE,EAAE,CAAC,CAAC;AAEP,IAAA,MAAM,YAAY,GAAmB;QACjC,YAAY;QACZ,cAAc;QACd,YAAY;QACZ,cAAc;QACd,OAAO;QACP,QAAQ;QACR,QAAQ;QACR,SAAS;KACZ,CAAC;IAEF,IAAI,OAAO,EAAE;AACT,QAAA,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC;QAC9B,WAAW,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC;KAC7C;IAED,OAAOA,cAAA,CAAA,aAAA,CAAC,QAAQ,EAAC,EAAA,KAAK,EAAE,YAAY,EAAA,EAAG,QAAQ,CAAY,CAAC;AAChE"}
@@ -1,13 +1,4 @@
1
- import React__default,{Component,Children,cloneElement}from'react';import {Consumer}from'./context.js';import {isEmptyElement}from'../utils/isEmptyElement.js';/**
2
- * Whether the argument is a function.
3
- *
4
- * @param {*} maybeFunc The argument to check.
5
- * @returns {boolean} True if the argument is a function, false otherwise.
6
- */
7
- function isFunction(maybeFunc) {
8
- return typeof maybeFunc === 'function';
9
- }
10
- class SlotComponent extends Component {
1
+ import React__default,{Component,Children,cloneElement}from'react';import {Consumer}from'./context.js';import {isFunction}from'../utils/index.js';import {PluginRender}from'../../plugin/plugin-render.js';import {isEmptyElement}from'../utils/isEmptyElement.js';class SlotComponent extends Component {
11
2
  node;
12
3
  isUnmounted;
13
4
  constructor(props) {
@@ -47,41 +38,48 @@ class SlotComponent extends Component {
47
38
  }
48
39
  render() {
49
40
  const { children, name, fillProps = {}, getFills, serverMode } = this.props;
41
+ const fills = getFills(name).filter((element) => !isEmptyElement(element));
42
+ if (fills.length > 0) {
43
+ if (isFunction(children)) {
44
+ const childrenFills = fills.map((fill) => {
45
+ const fillChildren = isFunction(fill.children)
46
+ ? fill.children(fillProps)
47
+ : fill.children;
48
+ return Children.map(fillChildren, (child, childIndex) => {
49
+ if (!child || typeof child === 'string') {
50
+ return child;
51
+ }
52
+ const childKey = child.key || childIndex;
53
+ return cloneElement(child, { key: childKey });
54
+ });
55
+ });
56
+ return React__default.createElement(React__default.Fragment, null, children(childrenFills));
57
+ }
58
+ else {
59
+ return React__default.createElement(PluginRender, { ...fillProps, name: name, fills: fills });
60
+ }
61
+ }
62
+ /*
50
63
  if (serverMode) {
51
64
  const fills = (getFills(name, this) ?? [])
52
- .map((fill, i) => {
53
- // unregisterFill(name, fill);
54
- if (typeof fill === 'function') {
55
- const child = fill({ ...fillProps, key: i });
56
- return React__default.createElement("div", { "data-slot-name": `slot-${name}` }, child);
57
- }
58
- return null;
59
- });
65
+ .map((fill: any, i) => {
66
+ // unregisterFill(name, fill);
67
+ if (typeof fill === 'function') {
68
+ const child = fill({...fillProps, key: i});
69
+ return <div data-slot-name={`slot-${name}`}>{child}</div>;
70
+ }
71
+ return null;
72
+ });
60
73
  return fills;
61
74
  }
62
- const fills = (getFills(name, this) ?? [])
63
- .map((fill) => {
64
- const fillChildren = isFunction(fill.children) ? fill.children(fillProps) : fill.children;
65
- return Children.map(fillChildren, (child, childIndex) => {
66
- if (!child || typeof child === 'string') {
67
- return child;
68
- }
69
- const childKey = child.key || childIndex;
70
- return cloneElement(child, { key: childKey });
71
- });
72
- })
73
- .filter(
74
- // In some cases fills are rendered only when some conditions apply.
75
- // This ensures that we only use non-empty fills when rendering, i.e.,
76
- // it allows us to render wrappers only when the fills are actually present.
77
- (element) => !isEmptyElement(element));
78
- return React__default.createElement(React__default.Fragment, null, isFunction(children) ? children(fills) : fills);
75
+ */
76
+ return null;
79
77
  }
80
78
  }
81
79
  const Slot = (props) => {
82
- const serverMode = (typeof window === 'undefined');
80
+ const serverMode = typeof window === 'undefined';
83
81
  return (React__default.createElement(Consumer, null, ({ registerSlot, unregisterSlot, getFills }) => (React__default.createElement(SlotComponent, { ...props,
84
- // We need to add id to fillProps with slot name,
82
+ // We need to add id to fillProps with slot name,
85
83
  // so that we can use it when remove the component during hydration.
86
84
  getFills: getFills, registerSlot: registerSlot, unregisterSlot: unregisterSlot, serverMode: serverMode }))));
87
85
  };export{Slot as default};//# sourceMappingURL=slot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"slot.js","sources":["../../../src/slot-fill/base/slot.tsx"],"sourcesContent":[null],"names":["React"],"mappings":"+JASA;;;;;AAKG;AACH,SAAS,UAAU,CAAC,SAAS,EAAA;AACzB,IAAA,OAAO,OAAO,SAAS,KAAK,UAAU,CAAC;AAC3C,CAAC;AAED,MAAM,aAAc,SAAQ,SAAmC,CAAA;AACnD,IAAA,IAAI,CAAU;AACd,IAAA,WAAW,CAAU;AAC7B,IAAA,WAAA,CAAY,KAA2B,EAAA;QACnC,KAAK,CAAC,KAAK,CAAC,CAAC;AACb,QAAA,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAC5C;IAEM,iBAAiB,GAAA;QACpB,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAChD,IAAI,CAAC,UAAU,EAAE;YACb,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;SACvC;KACJ;IAEM,oBAAoB,GAAA;AACvB,QAAA,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;AACtC,QAAA,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;KACzC;AAEM,IAAA,kBAAkB,CAAC,SAAS,EAAA;QACgB,IAAI,CAAC,MAAM;;;;;;KAO7D;AAEM,IAAA,QAAQ,CAAC,IAAa,EAAA;AAC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ACN"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/slot-fill/index.tsx"],"sourcesContent":[null],"names":["React","BaseFill","BubblesVirtuallyFill","BaseSlot","BubblesVirtuallySlotFillProvider"],"mappings":"6ZAgBM,SAAU,IAAI,CAAC,KAAK,EAAA;;;;AAIxB,IAAA,QACEA,cAAA,CAAA,aAAA,CAAAA,cAAA,CAAA,QAAA,EAAA,IAAA;QACEA,cAAC,CAAA,aAAA,CAAAC,MAAQ,EAAK,EAAA,GAAA,KAAK,EAAI,CAAA;AACvB,QAAAD,cAAA,CAAA,aAAA,CAACE,MAAoB,EAAK,EAAA,GAAA,KAAK,EAAI,CAAA,CAClC,EACH;AACJ,CAAC;AAEY,MAAA,IAAI,GAAG,UAAU,CAAC,CAAC,EAAE,gBAAgB,EAAE,GAAG,KAAK,EAAc,EAAE,GAAG,KAAI;IACjF,IAAI,gBAAgB,EAAE;QACpB,OAAOF,cAAA,CAAA,aAAA,CAAC,oBAAoB,EAAK,EAAA,GAAA,KAAK,EAAE,GAAG,EAAE,GAAG,EAAA,CAAI,CAAC;KACtD;AACD,IAAA,OAAOA,cAAC,CAAA,aAAA,CAAAG,MAAQ,EAAK,EAAA,GAAA,KAAK,GAAI,CAAC;AACjC,CAAC,EAAE;AAEG,SAAU,QAAQ,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAA;AAC7C,IAAA,QACEH,cAAA,CAAA,aAAA,CAAC,gBAAgB,EAAA,EAAA,GAAK,KAAK,EAAA;AACzB,QAAAA,cAAA,CAAA,aAAA,CAACI,kBAAgC,EAC9B,IAAA,EAAA,QAAQ,CACwB,CAClB,EACnB;AACJ,CAAC;AAEK,SAAU,cAAc,CAAkC,IAAY,EAAA;AAC1E,IAAA,MAAM,aAAa,GAAG,CAAC,KAAyB,KAAKJ,cAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,IAAI,EAAM,GAAA,KAAK,GAAI,CAAC;AACrF,IAAA,aAAa,CAAC,WAAW,GAAG,IAAI,GAAG,MAAM,CAAC;AAE1C,IAAA,MAAM,aAAa,GAAG,CAAC,KAAuB,KAAKA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,IAAI,EAAM,GAAA,KAAK,GAAI,CAAC;AACnF,IAAA,aAAa,CAAC,WAAW,GAAG,IAAI,GAAG,MAAM,CAAC;AAC1C,IAAA,aAAa,CAAC,cAAc,GAAG,IAAI,CAAC;IAEpC,OAAO;AACL,QAAA,IAAI,EAAE,aAAa;AACnB,QAAA,IAAI,EAAE,aAAa;KACpB,CAAC;AACJ"}
1
+ {"version":3,"file":"index.js","sources":["../../src/slot-fill/index.tsx"],"sourcesContent":[null],"names":["React","BaseFill","BubblesVirtuallyFill","BaseSlot","BubblesVirtuallySlotFillProvider"],"mappings":"6ZAaM,SAAU,IAAI,CAAC,KAAK,EAAA;;;;AAItB,IAAA,QACIA,cAAA,CAAA,aAAA,CAAAA,cAAA,CAAA,QAAA,EAAA,IAAA;QACIA,cAAC,CAAA,aAAA,CAAAC,MAAQ,EAAK,EAAA,GAAA,KAAK,EAAI,CAAA;AACvB,QAAAD,cAAA,CAAA,aAAA,CAACE,MAAoB,EAAK,EAAA,GAAA,KAAK,EAAI,CAAA,CACpC,EACL;AACN,CAAC;AAEY,MAAA,IAAI,GAAG,UAAU,CAAC,CAAC,EAAE,gBAAgB,EAAE,GAAG,KAAK,EAAc,EAAE,GAAG,KAAI;IAC/E,IAAI,gBAAgB,EAAE;QAClB,OAAOF,cAAA,CAAA,aAAA,CAAC,oBAAoB,EAAK,EAAA,GAAA,KAAK,EAAE,GAAG,EAAE,GAAG,EAAA,CAAI,CAAC;KACxD;AACD,IAAA,OAAOA,cAAC,CAAA,aAAA,CAAAG,MAAQ,EAAK,EAAA,GAAA,KAAK,GAAI,CAAC;AACnC,CAAC,EAAE;AAEG,SAAU,QAAQ,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAA;AAC3C,IAAA,QACIH,cAAA,CAAA,aAAA,CAAC,gBAAgB,EAAA,EAAA,GAAK,KAAK,EAAA;AACvB,QAAAA,cAAA,CAAA,aAAA,CAACI,kBAAgC,EAAE,IAAA,EAAA,QAAQ,CAAoC,CAChE,EACrB;AACN,CAAC;AAEK,SAAU,cAAc,CAAkC,IAAY,EAAA;AACxE,IAAA,MAAM,aAAa,GAAG,CAAC,KAAyB,KAAKJ,cAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,IAAI,EAAM,GAAA,KAAK,GAAI,CAAC;AACrF,IAAA,aAAa,CAAC,WAAW,GAAG,IAAI,GAAG,MAAM,CAAC;AAE1C,IAAA,MAAM,aAAa,GAAG,CAAC,KAAuB,KAAKA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,IAAI,EAAE,IAAI,EAAM,GAAA,KAAK,GAAI,CAAC;AACnF,IAAA,aAAa,CAAC,WAAW,GAAG,IAAI,GAAG,MAAM,CAAC;AAC1C,IAAA,aAAa,CAAC,cAAc,GAAG,IAAI,CAAC;IAEpC,OAAO;AACH,QAAA,IAAI,EAAE,aAAa;AACnB,QAAA,IAAI,EAAE,aAAa;KACtB,CAAC;AACN"}
@@ -1,4 +1,5 @@
1
1
  import { ReactNode, Component } from 'react';
2
+ import { IPlugin } from '@common-stack/client-core';
2
3
  export type Name = string | Symbol;
3
4
  export interface IFillProps {
4
5
  name: Name;
@@ -82,3 +83,8 @@ export interface ISlotProps {
82
83
  */
83
84
  serverMode?: boolean;
84
85
  }
86
+ export interface ILoadedPlugin extends IPlugin {
87
+ index?: number;
88
+ Component?: React.ComponentType<any>;
89
+ loaderData?: Record<string, any>;
90
+ }
@@ -1,3 +1,9 @@
1
1
  export * from './isEmptyElement';
2
2
  export * from './removeUniversalPortals';
3
- export * from './replaceServerFills';
3
+ /**
4
+ * Whether the argument is a function.
5
+ *
6
+ * @param {*} maybeFunc The argument to check.
7
+ * @returns {boolean} True if the argument is a function, false otherwise.
8
+ */
9
+ export declare function isFunction(maybeFunc: any): boolean;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Whether the argument is a function.
3
+ *
4
+ * @param {*} maybeFunc The argument to check.
5
+ * @returns {boolean} True if the argument is a function, false otherwise.
6
+ */
7
+ function isFunction(maybeFunc) {
8
+ return typeof maybeFunc === 'function';
9
+ }export{isFunction};//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/slot-fill/utils/index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAGA;;;;;AAKG;AACG,SAAU,UAAU,CAAC,SAAc,EAAA;AACrC,IAAA,OAAO,OAAO,SAAS,KAAK,UAAU,CAAC;AAC3C"}
@@ -4,4 +4,4 @@
4
4
  * @param element React Component to check.
5
5
  * @returns True when an element is considered empty.
6
6
  */
7
- export declare const isEmptyElement: (element: any) => boolean;
7
+ export declare const isEmptyElement: (element: any) => any;
@@ -11,5 +11,8 @@ const isEmptyElement = (element) => {
11
11
  if (typeof element?.valueOf() === 'string' || Array.isArray(element)) {
12
12
  return !element.length;
13
13
  }
14
+ if (typeof element === 'object' && element !== null) {
15
+ return Object.keys(element).length === 0 || Object.values(element).every((value) => isEmptyElement(value));
16
+ }
14
17
  return !element;
15
18
  };export{isEmptyElement};//# sourceMappingURL=isEmptyElement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isEmptyElement.js","sources":["../../../src/slot-fill/utils/isEmptyElement.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;;;AAKG;AAEU,MAAA,cAAc,GAAG,CAAE,OAAO,KAAK;AAC3C,IAAA,IAAK,OAAO,OAAO,KAAK,QAAQ,EAAG;AAClC,QAAA,OAAO,KAAK,CAAC;KACb;AAED,IAAA,IAAK,OAAO,OAAO,EAAE,OAAO,EAAE,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAE,OAAO,CAAE,EAAG;AACzE,QAAA,OAAO,CAAE,OAAO,CAAC,MAAM,CAAC;KACxB;IAED,OAAO,CAAE,OAAO,CAAC;AAClB"}
1
+ {"version":3,"file":"isEmptyElement.js","sources":["../../../src/slot-fill/utils/isEmptyElement.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;;;AAKG;AAEU,MAAA,cAAc,GAAG,CAAC,OAAO,KAAI;AACtC,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AAC7B,QAAA,OAAO,KAAK,CAAC;KAChB;AAED,IAAA,IAAI,OAAO,OAAO,EAAE,OAAO,EAAE,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;AAClE,QAAA,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;KAC1B;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE;AACjD,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;KAC9G;IAED,OAAO,CAAC,OAAO,CAAC;AACpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"removeUniversalPortals.js","sources":["../../../src/slot-fill/utils/removeUniversalPortals.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;AAEG;AACU,MAAA,sBAAsB,GAAG,CAAC,KAAe,KAAI;AACzD,IAAA,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;AAClC,QAAA,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AACrB,YAAA,QAAQ,CAAC,gBAAgB,CAAC,CAAA,qBAAA,EAAwB,IAAI,CAAA,CAAA,CAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;gBAC1E,IAAI,CAAC,MAAM,EAAE,CAAC;AAChB,aAAC,CAAC,CAAC;AACL,SAAC,CAAC,CAAC;KACL;AACF"}
1
+ {"version":3,"file":"removeUniversalPortals.js","sources":["../../../src/slot-fill/utils/removeUniversalPortals.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;AAEG;AACU,MAAA,sBAAsB,GAAG,CAAC,KAAe,KAAI;AACtD,IAAA,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;AACjC,QAAA,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AACnB,YAAA,QAAQ,CAAC,gBAAgB,CAAC,CAAA,qBAAA,EAAwB,IAAI,CAAA,CAAA,CAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;gBACxE,IAAI,CAAC,MAAM,EAAE,CAAC;AAClB,aAAC,CAAC,CAAC;AACP,SAAC,CAAC,CAAC;KACN;AACL"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common-stack/components-pro",
3
- "version": "8.0.1-alpha.0",
3
+ "version": "8.2.1-alpha.0",
4
4
  "description": "browser plugin for git",
5
5
  "homepage": "https://github.com/cdmbase/fullstack-pro#readme",
6
6
  "bugs": {
@@ -10,7 +10,7 @@
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/cdmbase/fullstack-pro.git"
12
12
  },
13
- "license": "MIT",
13
+ "license": "UNLICENSED",
14
14
  "author": "CDMBase LLC",
15
15
  "type": "module",
16
16
  "main": "lib/index.js",
@@ -24,17 +24,17 @@
24
24
  "build:lib:watch": "npm run build:lib -- --watch",
25
25
  "jest": "./node_modules/.bin/jest",
26
26
  "prepublish": "npm run build",
27
- "test": "jest",
27
+ "test": "vitest",
28
28
  "test:debug": "npm test -- --runInBand",
29
29
  "test:watch": "npm test -- --watch",
30
30
  "watch": "npm run build:lib:watch"
31
31
  },
32
32
  "dependencies": {
33
+ "@common-stack/client-core": "8.2.1-alpha.0",
33
34
  "@wordpress/element": "^5.30.0",
34
35
  "@wordpress/hooks": "^3.53.0",
35
36
  "@wordpress/is-shallow-equal": "^4.53.0",
36
37
  "@wordpress/warning": "^2.53.0",
37
- "cheerio": "^1.0.0",
38
38
  "history-with-query": "^4.10.4",
39
39
  "sort-keys": "^4.1.0",
40
40
  "valtio": "^1.7.0"
@@ -52,5 +52,5 @@
52
52
  "typescript": {
53
53
  "definition": "lib/index.d.ts"
54
54
  },
55
- "gitHead": "73d9088ae254fbc43425eed5c9f5cd95bd66e921"
55
+ "gitHead": "b46db06f987271c3a2e050f081e266d3a01b285b"
56
56
  }
@@ -1,9 +0,0 @@
1
- /**
2
- * Replace the wrapped dom element with `[data-slot-name]` to its children,
3
- * setting attrib [data-slot-name] same as parent.
4
- *
5
- * @param htmlContent Html content string.
6
- * @param fills fill names.
7
- * @returns The replaced html content string.
8
- */
9
- export declare const replaceServerFills: (htmlContent: string, fills: string[]) => string;
@@ -1,25 +0,0 @@
1
- import*as cheerio from'cheerio';/* eslint-disable @typescript-eslint/no-explicit-any */
2
- /* eslint-disable no-param-reassign */
3
- /**
4
- * Replace the wrapped dom element with `[data-slot-name]` to its children,
5
- * setting attrib [data-slot-name] same as parent.
6
- *
7
- * @param htmlContent Html content string.
8
- * @param fills fill names.
9
- * @returns The replaced html content string.
10
- */
11
- const replaceServerFills = (htmlContent, fills) => {
12
- const $ = cheerio.load(htmlContent);
13
- let newContent = htmlContent;
14
- fills.forEach((name) => {
15
- $(`[data-slot-name=slot-${name}]`).each((i, node) => {
16
- const search = $(node).prop('outerHTML');
17
- node.children.forEach((child) => {
18
- child.attribs['data-slot-name'] = `slot-${name}`;
19
- });
20
- const replace = $(node).html() || '';
21
- newContent = newContent.replace(search, replace);
22
- });
23
- });
24
- return newContent;
25
- };export{replaceServerFills};//# sourceMappingURL=replaceServerFills.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replaceServerFills.js","sources":["../../../src/slot-fill/utils/replaceServerFills.ts"],"sourcesContent":[null],"names":[],"mappings":"gCAAA;AACA;AAEA;;;;;;;AAOG;MACU,kBAAkB,GAAG,CAAC,WAAmB,EAAE,KAAe,KAAI;IACvE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACpC,IAAI,UAAU,GAAG,WAAW,CAAC;AAE7B,IAAA,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AACnB,QAAA,CAAC,CAAC,CAAA,qBAAA,EAAwB,IAAI,CAAA,CAAA,CAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,KAAI;YAChD,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACzC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;gBAC3B,KAAoC,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAA,KAAA,EAAQ,IAAI,CAAA,CAAE,CAAC;AACrF,aAAC,CAAC,CAAC;YACH,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;YACrC,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrD,SAAC,CAAC,CAAC;AACP,KAAC,CAAC,CAAC;AAEH,IAAA,OAAO,UAAU,CAAC;AACtB"}