@sitecore-feaas/clientside 0.0.9 → 0.1.1
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 +5 -5
- package/dist/browser/basic.cjs +67 -0
- package/dist/browser/basic.js +67 -0
- package/dist/browser/index.cjs +68 -79
- package/dist/browser/index.js +68 -79
- package/dist/node/{react.cjs → basic.cjs} +436 -443
- package/dist/node/{react.js → basic.js} +432 -439
- package/dist/node/index.cjs +666 -291
- package/dist/node/index.js +666 -295
- package/examples/index.html +1 -1
- package/package.json +17 -17
- package/src/basic.ts +5 -0
- package/src/cloud.ts +9 -5
- package/src/components/FEAASBase.tsx +265 -0
- package/src/components/FEAASComponent.ts +98 -0
- package/src/components/FEAASContext.tsx +105 -0
- package/src/components/FEAASEditor.tsx +291 -0
- package/src/components/FEAASLoader.ts +113 -0
- package/src/components/FEAASPicker.tsx +98 -0
- package/src/components/FEAASStylesheet.ts +43 -0
- package/src/components/index.tsx +7 -0
- package/src/index.ts +4 -11
- package/test/components.js +11 -0
- package/test/components.ts +12 -0
- package/test/render.js +688 -0
- package/tsconfig.json +11 -6
- package/types/basic.d.ts +5 -0
- package/types/cloud.d.ts +18 -0
- package/types/components/FEAASBase.d.ts +70 -0
- package/types/components/FEAASComponent.d.ts +39 -0
- package/types/components/FEAASContext.d.ts +43 -0
- package/types/components/FEAASEditor.d.ts +70 -0
- package/types/components/FEAASLoader.d.ts +20 -0
- package/types/components/FEAASPicker.d.ts +61 -0
- package/types/components/FEAASStylesheet.d.ts +25 -0
- package/types/components/index.d.ts +7 -0
- package/types/dom.d.ts +29 -0
- package/types/fetch.d.ts +1 -0
- package/types/index.d.ts +4 -0
- package/types/tsbuildinfo +1 -0
- package/dist/browser/index.d.ts +0 -25
- package/dist/browser/react.cjs +0 -83
- package/dist/browser/react.d.ts +0 -36
- package/dist/browser/react.js +0 -83
- package/dist/browser/webcomponent-6b45b819.d.ts +0 -120
- package/dist/node/index.d.ts +0 -25
- package/dist/node/react.d.ts +0 -36
- package/dist/node/webcomponent-6b45b819.d.ts +0 -120
- package/index.cjs +0 -83
- package/index.d.ts +0 -25
- package/index.js +0 -83
- package/react.cjs +0 -83
- package/react.d.ts +0 -36
- package/react.js +0 -83
- package/src/react.ts +0 -66
- package/src/webcomponent.ts +0 -393
- package/webcomponent-6b45b819.d.ts +0 -120
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
interface CloudTemplate {
|
|
2
|
-
hostname?: string;
|
|
3
|
-
library: string;
|
|
4
|
-
component: string;
|
|
5
|
-
version: string;
|
|
6
|
-
revision?: string;
|
|
7
|
-
}
|
|
8
|
-
interface CloudStylesheet {
|
|
9
|
-
hostname?: string;
|
|
10
|
-
library: string;
|
|
11
|
-
revision?: string;
|
|
12
|
-
}
|
|
13
|
-
declare function getComponentURL({ hostname, library, component, version, revision }: CloudTemplate): string;
|
|
14
|
-
declare function getStylesheetURL({ hostname, library, revision }: CloudStylesheet): string;
|
|
15
|
-
declare function fetchComponent(props: CloudTemplate, callback: (html: string) => void): Promise<Response>;
|
|
16
|
-
declare function fetchStylesheet(props: CloudStylesheet, callback: (css: string) => void): Promise<Response>;
|
|
17
|
-
|
|
18
|
-
interface FEAASCustomizations {
|
|
19
|
-
processTemplate?: (element: HTMLElement, template: string, data: any) => string;
|
|
20
|
-
processData?: (element: HTMLElement, data: any) => any;
|
|
21
|
-
processValue?: (element: HTMLElement, property: string, value: any) => any;
|
|
22
|
-
shouldRepeat?: (element: HTMLElement, value: any) => boolean;
|
|
23
|
-
onRender?: (element: HTMLElement, data: any) => void;
|
|
24
|
-
}
|
|
25
|
-
interface ExplicitTemplate {
|
|
26
|
-
template: string;
|
|
27
|
-
}
|
|
28
|
-
declare type Datascopes = Record<string, any>;
|
|
29
|
-
declare type FEAASComponentProps = {
|
|
30
|
-
data?: Datascopes;
|
|
31
|
-
} & (ExplicitTemplate | CloudTemplate) & FEAASCustomizations;
|
|
32
|
-
declare function renderComponentElement(content: string, datasources?: Datascopes): HTMLDivElement;
|
|
33
|
-
declare function cleanCollectionBit(path: string): string;
|
|
34
|
-
declare function normalizeCollectionScope(path: string): string;
|
|
35
|
-
declare function queryScopes(scopes: any, datapath: string, singleValue?: boolean, json?: any): any;
|
|
36
|
-
declare function setDOMAttribute(element: HTMLElement, attribute: string, value: any, config?: FEAASCustomizations): void;
|
|
37
|
-
declare function observeDOMElement(element: HTMLElement): MutationObserver;
|
|
38
|
-
declare function autoloadScripts(element: HTMLElement, observe?: boolean): MutationObserver;
|
|
39
|
-
declare function loadScript(element: HTMLElement, src: string): boolean;
|
|
40
|
-
declare function renderDOMElement(input: HTMLElement | DocumentFragment, datascopes?: any, config?: FEAASCustomizations, isNested?: boolean): HTMLElement;
|
|
41
|
-
declare function renderDOMContent(root: HTMLElement, template: string, data?: Datascopes, config?: FEAASCustomizations): HTMLElement;
|
|
42
|
-
declare function renderStylesheet(props: CloudStylesheet, style?: HTMLStyleElement): HTMLStyleElement;
|
|
43
|
-
declare function renderStylesheetPromise(props: CloudStylesheet, style?: HTMLStyleElement): Promise<HTMLStyleElement>;
|
|
44
|
-
declare function renderComponent(props: FEAASComponentProps, root?: HTMLElement): HTMLElement;
|
|
45
|
-
declare function renderComponentPromise(props: FEAASComponentProps, root?: HTMLElement): Promise<HTMLElement>;
|
|
46
|
-
|
|
47
|
-
declare global {
|
|
48
|
-
namespace JSX {
|
|
49
|
-
interface IntrinsicElements {
|
|
50
|
-
'feaas-component': {
|
|
51
|
-
data?: any;
|
|
52
|
-
library: string;
|
|
53
|
-
component: string;
|
|
54
|
-
version: string;
|
|
55
|
-
revision?: string;
|
|
56
|
-
hostname?: string;
|
|
57
|
-
template?: string;
|
|
58
|
-
children?: any;
|
|
59
|
-
};
|
|
60
|
-
'feaas-stylesheet': {
|
|
61
|
-
library?: string;
|
|
62
|
-
hostname?: string;
|
|
63
|
-
children?: any;
|
|
64
|
-
};
|
|
65
|
-
'feaas-picker': {
|
|
66
|
-
library: string;
|
|
67
|
-
mode?: string;
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
declare var WebComponent: {
|
|
73
|
-
new (): HTMLElement;
|
|
74
|
-
prototype: HTMLElement;
|
|
75
|
-
};
|
|
76
|
-
declare class HTMLFeaasComponent extends WebComponent {
|
|
77
|
-
static get observedAttributes(): string[];
|
|
78
|
-
connected: boolean;
|
|
79
|
-
template: string;
|
|
80
|
-
data: any;
|
|
81
|
-
isFetching: boolean;
|
|
82
|
-
rendering: ReturnType<typeof requestAnimationFrame>;
|
|
83
|
-
connectedCallback(): void;
|
|
84
|
-
disconnectedCallback(): void;
|
|
85
|
-
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
86
|
-
update(): void;
|
|
87
|
-
setData(data: any): void;
|
|
88
|
-
getOriginal(): HTMLFeaasComponent;
|
|
89
|
-
getData(): any;
|
|
90
|
-
render(): void;
|
|
91
|
-
getProps(): CloudTemplate & {
|
|
92
|
-
data: Datascopes;
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
declare class HTMLFeaasStylesheet extends WebComponent {
|
|
96
|
-
static get observedAttributes(): string[];
|
|
97
|
-
connected: boolean;
|
|
98
|
-
connectedCallback(): void;
|
|
99
|
-
attributeChangedCallback(): void;
|
|
100
|
-
render(): void;
|
|
101
|
-
getProps(): {
|
|
102
|
-
library: string;
|
|
103
|
-
revision: string;
|
|
104
|
-
hostname: string;
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
interface PickerProps<T = HTMLElement> {
|
|
108
|
-
children?: any;
|
|
109
|
-
context?: T;
|
|
110
|
-
isOpen?: boolean;
|
|
111
|
-
mode?: 'library' | 'stylesheet';
|
|
112
|
-
src?: string;
|
|
113
|
-
onClose?: () => any;
|
|
114
|
-
}
|
|
115
|
-
interface HTMLFeaasPickerProps extends Omit<PickerProps<HTMLElement>, 'children'> {
|
|
116
|
-
getAccessTokenSilently: (options: any) => Promise<string>;
|
|
117
|
-
library: string;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export { CloudStylesheet as C, Datascopes as D, ExplicitTemplate as E, FEAASCustomizations as F, HTMLFeaasComponent as H, PickerProps as P, HTMLFeaasStylesheet as a, FEAASComponentProps as b, cleanCollectionBit as c, autoloadScripts as d, renderDOMElement as e, renderDOMContent as f, renderStylesheet as g, renderStylesheetPromise as h, renderComponent as i, renderComponentPromise as j, HTMLFeaasPickerProps as k, loadScript as l, CloudTemplate as m, normalizeCollectionScope as n, observeDOMElement as o, getComponentURL as p, queryScopes as q, renderComponentElement as r, setDOMAttribute as s, getStylesheetURL as t, fetchComponent as u, fetchStylesheet as v };
|