@pepperi-addons/ngx-lib-react 0.5.12 → 0.5.14
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/elements/3rdpartylicenses.txt +24 -0
- package/elements/main.js +1 -1
- package/elements/runtime.js +1 -1
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +1 -1
- package/pep-addon-block-loader.d.ts +15 -0
- package/pep-addon-block-loader.js +40 -0
- package/pep-remote-loader.d.ts +10 -0
- package/pep-remote-loader.js +26 -0
- package/elements/register.auto.js +0 -1
- package/elements/register.js +0 -1
package/elements/runtime.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e,
|
|
1
|
+
(()=>{"use strict";var e,g={},O={};function t(e){var n=O[e];if(void 0!==n)return n.exports;var r=O[e]={id:e,loaded:!1,exports:{}};return g[e].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}t.m=g,e=[],t.O=(n,r,i,a)=>{if(!r){var o=1/0;for(f=0;f<e.length;f++){for(var[r,i,a]=e[f],l=!0,c=0;c<r.length;c++)(!1&a||o>=a)&&Object.keys(t.O).every(b=>t.O[b](r[c]))?r.splice(c--,1):(l=!1,a<o&&(o=a));if(l){e.splice(f--,1);var h=i();void 0!==h&&(n=h)}}return n}a=a||0;for(var f=e.length;f>0&&e[f-1][2]>a;f--)e[f]=e[f-1];e[f]=[r,i,a]},t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},(()=>{var n,e=Object.getPrototypeOf?r=>Object.getPrototypeOf(r):r=>r.__proto__;t.t=function(r,i){if(1&i&&(r=this(r)),8&i||"object"==typeof r&&r&&(4&i&&r.__esModule||16&i&&"function"==typeof r.then))return r;var a=Object.create(null);t.r(a);var f={};n=n||[null,e({}),e([]),e(e)];for(var o=2&i&&r;"object"==typeof o&&!~n.indexOf(o);o=e(o))Object.getOwnPropertyNames(o).forEach(l=>f[l]=()=>r[l]);return f.default=()=>r,t.d(a,f),a}})(),t.d=(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{t.S={};var e={},n={};t.I=(r,i)=>{i||(i=[]);var a=n[r];if(a||(a=n[r]={}),!(i.indexOf(a)>=0)){if(i.push(a),e[r])return e[r];t.o(t.S,r)||(t.S[r]={});var v=[];return e[r]=v.length?Promise.all(v).then(()=>e[r]=1):1}}})(),(()=>{var e={666:0};t.O.j=i=>0===e[i];var n=(i,a)=>{var c,h,[f,o,l]=a,v=0;if(f.some(_=>0!==e[_])){for(c in o)t.o(o,c)&&(t.m[c]=o[c]);if(l)var u=l(t)}for(i&&i(a);v<f.length;v++)t.o(e,h=f[v])&&e[h]&&e[h][0](),e[h]=0;return t.O(u)},r=self.webpackChunkngx_lib_elements=self.webpackChunkngx_lib_elements||[];r.forEach(n.bind(null,0)),r.push=n.bind(null,r.push.bind(r))})()})();
|
package/index.d.ts
CHANGED
|
@@ -30,5 +30,7 @@ export { PepTopBar } from './pep-top-bar.js';
|
|
|
30
30
|
export { PepListChooser } from './pep-list-chooser.js';
|
|
31
31
|
export * from './pep-color-picker.js';
|
|
32
32
|
export * from './pep-query-builder.js';
|
|
33
|
+
export * from './pep-remote-loader.js';
|
|
34
|
+
export * from './pep-addon-block-loader.js';
|
|
33
35
|
export { PepRichHtmlTextarea } from './pep-rich-html-textarea.js';
|
|
34
36
|
export * from './services.js';
|
package/index.js
CHANGED
|
@@ -30,6 +30,8 @@ export { PepTopBar } from './pep-top-bar.js';
|
|
|
30
30
|
export { PepListChooser } from './pep-list-chooser.js';
|
|
31
31
|
export * from './pep-color-picker.js';
|
|
32
32
|
export * from './pep-query-builder.js';
|
|
33
|
+
export * from './pep-remote-loader.js';
|
|
34
|
+
export * from './pep-addon-block-loader.js';
|
|
33
35
|
export { PepRichHtmlTextarea } from './pep-rich-html-textarea.js';
|
|
34
36
|
// Export all service helpers (bridge-based access to Angular services)
|
|
35
37
|
export * from './services.js';
|
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type PepAddonBlockLoaderRemoteLoaderOptions = Record<string, unknown>;
|
|
3
|
+
export interface PepAddonBlockLoaderProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
|
+
keyProp?: string;
|
|
5
|
+
addonId?: string;
|
|
6
|
+
remoteEntry?: string;
|
|
7
|
+
slugName?: string;
|
|
8
|
+
blockType?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
hostObject?: unknown;
|
|
11
|
+
remoteLoaderOptions?: PepAddonBlockLoaderRemoteLoaderOptions;
|
|
12
|
+
onHostEvents?: (event: any) => void;
|
|
13
|
+
onBlockLoad?: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const PepAddonBlockLoader: React.FC<PepAddonBlockLoaderProps>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
export const PepAddonBlockLoader = ({ keyProp, addonId, remoteEntry, slugName, blockType, name, hostObject, remoteLoaderOptions, onHostEvents, onBlockLoad, ...rest }) => {
|
|
4
|
+
const ref = useRef(null);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const el = ref.current;
|
|
7
|
+
if (!el)
|
|
8
|
+
return;
|
|
9
|
+
if (typeof addonId !== 'undefined')
|
|
10
|
+
el.addonId = addonId;
|
|
11
|
+
if (typeof remoteEntry !== 'undefined')
|
|
12
|
+
el.remoteEntry = remoteEntry;
|
|
13
|
+
if (typeof slugName !== 'undefined')
|
|
14
|
+
el.slugName = slugName;
|
|
15
|
+
if (typeof blockType !== 'undefined')
|
|
16
|
+
el.blockType = blockType;
|
|
17
|
+
if (typeof name !== 'undefined')
|
|
18
|
+
el.name = name;
|
|
19
|
+
if (typeof hostObject !== 'undefined')
|
|
20
|
+
el.hostObject = hostObject;
|
|
21
|
+
if (typeof remoteLoaderOptions !== 'undefined')
|
|
22
|
+
el.remoteLoaderOptions = remoteLoaderOptions;
|
|
23
|
+
}, [addonId, remoteEntry, slugName, blockType, name, hostObject, remoteLoaderOptions]);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const el = ref.current;
|
|
26
|
+
if (!el)
|
|
27
|
+
return;
|
|
28
|
+
const handlers = [];
|
|
29
|
+
if (onHostEvents) {
|
|
30
|
+
handlers.push(['hostEvents', (e) => { var _a; return onHostEvents((_a = e.detail) !== null && _a !== void 0 ? _a : e); }]);
|
|
31
|
+
}
|
|
32
|
+
if (onBlockLoad) {
|
|
33
|
+
handlers.push(['blockLoad', () => onBlockLoad()]);
|
|
34
|
+
}
|
|
35
|
+
handlers.forEach(([n, h]) => el.addEventListener(n, h));
|
|
36
|
+
return () => handlers.forEach(([n, h]) => el.removeEventListener(n, h));
|
|
37
|
+
}, [onHostEvents, onBlockLoad]);
|
|
38
|
+
return _jsx("pep-addon-block-loader-element", { ref: ref, ...rest }, keyProp);
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=pep-addon-block-loader.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type PepRemoteLoaderOptions = Record<string, unknown>;
|
|
3
|
+
export interface PepRemoteLoaderProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
|
+
keyProp?: string;
|
|
5
|
+
options?: PepRemoteLoaderOptions;
|
|
6
|
+
props?: Record<string, unknown>;
|
|
7
|
+
events?: Record<string, (event: Event) => void>;
|
|
8
|
+
onLoad?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const PepRemoteLoader: React.FC<PepRemoteLoaderProps>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
export const PepRemoteLoader = ({ keyProp, options, props, events, onLoad, ...rest }) => {
|
|
4
|
+
const ref = useRef(null);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const el = ref.current;
|
|
7
|
+
if (!el)
|
|
8
|
+
return;
|
|
9
|
+
if (typeof options !== 'undefined')
|
|
10
|
+
el.options = options;
|
|
11
|
+
if (typeof props !== 'undefined')
|
|
12
|
+
el.props = props;
|
|
13
|
+
if (typeof events !== 'undefined')
|
|
14
|
+
el.events = events;
|
|
15
|
+
}, [options, props, events]);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const el = ref.current;
|
|
18
|
+
if (!el || !onLoad)
|
|
19
|
+
return;
|
|
20
|
+
const handler = () => onLoad();
|
|
21
|
+
el.addEventListener('load', handler);
|
|
22
|
+
return () => el.removeEventListener('load', handler);
|
|
23
|
+
}, [onLoad]);
|
|
24
|
+
return _jsx("pep-remote-loader-element", { ref: ref, ...rest }, keyProp);
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=pep-remote-loader.js.map
|