@claspo/renderer 16.7.0-theme.13 → 17.0.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/CompositionRoot.d.ts +2 -35
- package/CompositionRoot.js +1 -1
- package/RouterEvent.d.ts +4 -3
- package/StaticEntryModule.d.ts +21 -18
- package/StaticEntryModule.js +1 -1
- package/UpdatingEntryModule.d.ts +10 -14
- package/UpdatingEntryModule.js +1 -1
- package/ViewRouter.d.ts +8 -7
- package/action/ActionFactory.d.ts +10 -10
- package/action/ActionRegister.d.ts +24 -7
- package/action/InAppActionFactory.d.ts +1 -1
- package/action/SysActionTypes.d.ts +12 -12
- package/action/actions/ActionCategory.d.ts +4 -4
- package/action/actions/BaseRequestAction.d.ts +9 -9
- package/action/actions/BaseRequestAction.js +1 -1
- package/action/actions/CloseWidgetAction.d.ts +5 -5
- package/action/actions/CloseWidgetAction.js +1 -1
- package/action/actions/DispatchEventAction.d.ts +2 -2
- package/action/actions/GoToNextViewAction.d.ts +2 -2
- package/action/actions/GoToNextViewAction.js +1 -1
- package/action/actions/GoToPreviousViewAction.d.ts +2 -2
- package/action/actions/GoToPreviousViewAction.js +1 -1
- package/action/actions/GoToViewAction.d.ts +3 -4
- package/action/actions/GoToViewAction.js +1 -1
- package/action/actions/InAppOpenLinkAction.d.ts +2 -2
- package/action/actions/OpenLinkAction.d.ts +7 -7
- package/action/actions/OpenLinkAction.js +1 -1
- package/action/actions/RequestAction.d.ts +3 -1
- package/action/actions/ShowWidgetAction.d.ts +2 -2
- package/action/actions/SubscribeContactAction.d.ts +4 -1
- package/action/asyncAction.d.ts +2 -2
- package/backward-compatibility/deprecatedCheckboxVariablesMap.d.ts +1 -1
- package/color-libs/color-convert.d.ts +1 -1
- package/color-libs/color-string.d.ts +4 -14
- package/color-libs/color.d.ts +1 -13
- package/color-libs/conversions.d.ts +10 -8
- package/color-libs/rgb.d.ts +1 -1
- package/color-libs/route.d.ts +1 -1
- package/color-libs/simple-swizzle.d.ts +1 -4
- package/common/ConfigService.d.ts +5 -3
- package/common/ConfigService.js +1 -1
- package/common/DefaultState.d.ts +7 -4
- package/common/SysEventTypes.d.ts +6 -6
- package/common/WaitForKeyboardHide.d.ts +1 -1
- package/document-model/ComponentPropsExtractor.d.ts +1 -1
- package/document-model/DocumentModelService.d.ts +32 -0
- package/document-model/{DocumentModel.js → DocumentModelService.js} +1 -1
- package/document-model/DocumentService.d.ts +3 -3
- package/document-model/DocumentService.js +1 -1
- package/document-model/MergeAdaptiveStylesWithEnvIndependentStyles.d.ts +2 -1
- package/document-model/MergeAdaptiveStylesWithEnvIndependentStyles.js +1 -1
- package/document-model/ViewEntryType.d.ts +13 -13
- package/document-model/systemResultStateNames.d.ts +1 -1
- package/form/FormControl.d.ts +22 -25
- package/form/FormControl.interface.d.ts +19 -0
- package/form/FormControl.interface.js +1 -0
- package/form/FormControl.js +1 -1
- package/form/FormControlEvents.d.ts +7 -5
- package/form/FormControlValidator.d.ts +9 -8
- package/form/FormControlValidator.interface.d.ts +23 -0
- package/form/FormControlValidator.interface.js +1 -0
- package/form/FormGroup.d.ts +18 -13
- package/form/FormGroup.interface.d.ts +7 -0
- package/form/FormGroup.interface.js +1 -0
- package/form/FormGroup.js +1 -1
- package/form/FormGroupEvents.d.ts +10 -7
- package/generateRandomValue.d.ts +1 -1
- package/handler/ClickHandler.d.ts +8 -8
- package/handler/ComponentEventHandler.d.ts +1 -1
- package/handler/HandlerFactory.d.ts +3 -3
- package/i18n/TranslateUtils.d.ts +22 -7
- package/i18n/TranslateUtils.js +1 -1
- package/package.json +2 -2
- package/prize-pool/PrizePool.d.ts +1 -1
- package/prize-pool/PrizePoolEvents.d.ts +6 -4
- package/prize-pool/PrizePoolFactory.d.ts +2 -2
- package/renderer/DragEventListener.d.ts +1 -1
- package/renderer/RenderConstants.d.ts +6 -6
- package/renderer/ViewRendererActionType.d.ts +15 -15
- package/renderer/style/ClDocumentResizeListener.d.ts +5 -4
- package/renderer/style/ClDocumentResizeListener.js +1 -1
- package/renderer/style/ColorSchemaListener.d.ts +38 -23
- package/renderer/style/ColorSchemaListener.js +1 -1
- package/renderer/style/CommonStylesService.d.ts +4 -3
- package/renderer/style/DefaultMediaQueryListener.d.ts +15 -9
- package/renderer/style/DefaultMediaQueryListener.js +1 -1
- package/renderer/style/LoopAnimationStylesService.d.ts +1 -1
- package/renderer/style/MobileDeviceOrientationListener.d.ts +19 -6
- package/renderer/style/MobileDeviceOrientationListener.js +1 -1
- package/resource-management/ComponentResourceManager.d.ts +12 -10
- package/resource-management/Counter.d.ts +3 -2
- package/resource-management/ViewResourcesManager.d.ts +2 -2
- package/sdk/ColorUtils.d.ts +7 -7
- package/sdk/ComponentType.d.ts +9 -9
- package/sdk/FormUtils.d.ts +3 -3
- package/sdk/FormUtils.js +1 -1
- package/sdk/HtmlStyleUtils.d.ts +27 -7
- package/sdk/HtmlStyleUtils.js +1 -1
- package/sdk/ModelStyleUtils.d.ts +11 -9
- package/sdk/ModelStyleUtils.js +1 -1
- package/sdk/OverlayUtils.d.ts +44 -28
- package/sdk/OverlayUtils.js +1 -1
- package/sdk/PreviewMode.d.ts +6 -5
- package/sdk/TooltipUtils.d.ts +10 -4
- package/sdk/TooltipUtils.js +1 -1
- package/sdk/TranslationUtils.d.ts +9 -4
- package/sdk/TranslationUtils.js +1 -1
- package/sdk/WcControlledElement.d.ts +48 -23
- package/sdk/WcControlledElement.js +1 -1
- package/sdk/WcElement.d.ts +123 -56
- package/sdk/WcElement.js +1 -1
- package/sdk/context/ContextData.d.ts +26 -7
- package/sdk/context/ContextEvents.d.ts +6 -5
- package/sdk/context/ContextSDK.d.ts +26 -13
- package/sdk/context/Record.d.ts +7 -6
- package/sdk/getComponentCountOnView.d.ts +2 -1
- package/sdk/merge-tags/AbstractMergeTagsProcessor.d.ts +20 -8
- package/sdk/merge-tags/AbstractMergeTagsProcessor.js +1 -1
- package/sdk/merge-tags/MergeTagsProcessorFactory.d.ts +9 -8
- package/sdk/merge-tags/StaticMergeTagsProcessor.d.ts +2 -1
- package/sdk/merge-tags/UpdatingMergeTagsProcessor.d.ts +5 -3
- package/sdk/merge-tags/UpdatingMergeTagsProcessor.js +1 -1
- package/sdk/source/Source.d.ts +14 -6
- package/sdk/source/SourceRegistry.d.ts +15 -7
- package/sdk/source/sources/DataLayerSource.d.ts +24 -9
- package/sdk/source/sources/DataLayerSource.js +1 -1
- package/sdk/source/sources/FormSource.d.ts +6 -4
- package/sdk/source/sources/JSApiVariablesSource.d.ts +28 -10
- package/sdk/source/sources/JSApiVariablesSource.js +1 -1
- package/sdk/source/sources/UrlQueryParamsSource.d.ts +23 -10
- package/sdk/source/sources/UrlQueryParamsSource.js +1 -1
- package/sdk/validators/required.d.ts +4 -4
- package/sdk.d.ts +3 -3
- package/sdk.js +1 -1
- package/wc-renderer/WcFactory.d.ts +17 -17
- package/wc-renderer/WcFactory.js +1 -1
- package/wc-renderer/WcRegister.d.ts +15 -9
- package/wc-renderer/WcRegister.js +1 -1
- package/wc-renderer/WcResolver.d.ts +24 -13
- package/wc-renderer/WcResolver.js +1 -1
- package/wc-renderer/WcViewRenderer.d.ts +4 -5
- package/wc-renderer/WcViewRenderer.js +1 -1
- package/wc-renderer/decorators/wcStaticDecorator.d.ts +4 -7
- package/wc-renderer/decorators/wcStaticDecorator.js +1 -1
- package/wc-renderer/decorators/wcUpdatingDecorator.d.ts +8 -8
- package/wc-renderer/icons/feedbackIcons.d.ts +10 -23
- package/wc-renderer/icons/promoCodeCopyIcons.d.ts +1 -1
- package/wc-renderer/icons/promoCodeStrokeIcons.d.ts +1 -1
- package/wc-renderer/observers/createObservers.d.ts +6 -4
- package/wc-renderer/observers/observerType.d.ts +5 -5
- package/wc-renderer/subscriptions/createSubscriptions.d.ts +7 -4
- package/wc-renderer/utils/platforms.d.ts +5 -5
- package/action/actions/TrackClick.d.ts +0 -5
- package/action/actions/TrackClick.js +0 -1
- package/document-model/DocumentModel.d.ts +0 -30
- package/sdk/ComponentLifeCycleContainerType.d.ts +0 -5
- package/sdk/ComponentLifeCycleContainerType.js +0 -1
- package/sdk/TranslationUtils.spec.d.ts +0 -1
- package/sdk/TranslationUtils.spec.js +0 -1
- package/sdk/context/ContextSDK.spec.d.ts +0 -1
- package/sdk/context/ContextSDK.spec.js +0 -1
- package/wc-renderer/WcFactory.spec.d.ts +0 -1
- package/wc-renderer/WcFactory.spec.js +0 -1
- package/wc-renderer/WcRegister.spec.d.ts +0 -1
- package/wc-renderer/WcRegister.spec.js +0 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import AbstractMergeTagsProcessor from './AbstractMergeTagsProcessor';
|
|
1
2
|
export default class UpdatingMergeTagsProcessor extends AbstractMergeTagsProcessor {
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
contextSubscriptions: any;
|
|
4
|
+
constructor(context: any, configService: any);
|
|
5
|
+
destroy(): void;
|
|
6
|
+
processSingleMergeTag(tagContainerElement: any, mergeTag: any): void;
|
|
4
7
|
_setMergeTagValidity(contextRecord: any, mergeTag: any, tagContainerElement: any): void;
|
|
5
8
|
_handleContextEvents(record: any): void;
|
|
6
9
|
}
|
|
7
|
-
import AbstractMergeTagsProcessor from "./AbstractMergeTagsProcessor";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ContextEvents}from"../context/ContextEvents";import AbstractMergeTagsProcessor from"./AbstractMergeTagsProcessor";import getMostNestedNode from"@claspo/common/dom/getMostNestedNode";import DataLayerSource from"../source/sources/DataLayerSource";import UrlQueryParamsSource from"../source/sources/UrlQueryParamsSource";import JSApiVariablesSource from"../source/sources/JSApiVariablesSource";export default class UpdatingMergeTagsProcessor extends AbstractMergeTagsProcessor{constructor(e){super(e),this.contextSubscriptions=[this.context.on(ContextEvents.RECORD_ADDED,this._handleContextEvents.bind(this)),this.context.on(ContextEvents.RECORD_UPDATED,this._handleContextEvents.bind(this)),this.context.on(ContextEvents.RECORD_DELETED,this._handleContextEvents.bind(this))]}destroy(){super.destroy(),this.contextSubscriptions&&this.contextSubscriptions.forEach(e=>e.off())}processSingleMergeTag(e,t){if(!e)return;const s=this.context.getRecord(t.id);e.style.fontFamily="inherit",getMostNestedNode(e).textContent=t.exampleValue,this._setMergeTagValidity(s,t,e)}_setMergeTagValidity(e,t,s){let r=!1;if(e||t.sourceId===DataLayerSource.sourceId||t.sourceId===UrlQueryParamsSource.sourceId||t.sourceId===JSApiVariablesSource.sourceId||(r=!0),t.sourceId===DataLayerSource.sourceId){const e=t.arguments.find(e=>"dataLayerPropPath"===e.name);e&&e.value||(r=!0)}else{(!t.exampleValue||t.arguments&&!t.arguments.find(e=>e.value))&&(r=!0)}const o="tag-error";r?s.classList.add(o):s.classList.remove(o)}_handleContextEvents(e){var t;const s=null===(t=this.mergeTags)||void 0===t?void 0:t[e.key];s&&this.processSingleMergeTag(this.element.querySelector(`[cl-id="${s.id}"]`),s)}}
|
|
1
|
+
import{ContextEvents}from"../context/ContextEvents";import AbstractMergeTagsProcessor from"./AbstractMergeTagsProcessor";import getMostNestedNode from"@claspo/common/dom/getMostNestedNode";import DataLayerSource from"../source/sources/DataLayerSource";import UrlQueryParamsSource from"../source/sources/UrlQueryParamsSource";import JSApiVariablesSource from"../source/sources/JSApiVariablesSource";export default class UpdatingMergeTagsProcessor extends AbstractMergeTagsProcessor{constructor(e,t){super(e,t),this.contextSubscriptions=[this.context.on(ContextEvents.RECORD_ADDED,this._handleContextEvents.bind(this)),this.context.on(ContextEvents.RECORD_UPDATED,this._handleContextEvents.bind(this)),this.context.on(ContextEvents.RECORD_DELETED,this._handleContextEvents.bind(this))]}destroy(){super.destroy(),this.contextSubscriptions&&this.contextSubscriptions.forEach(e=>e.off())}processSingleMergeTag(e,t){if(!e)return;const s=this.context.getRecord(t.id);e.style.fontFamily="inherit",getMostNestedNode(e).textContent=t.exampleValue,this._setMergeTagValidity(s,t,e)}_setMergeTagValidity(e,t,s){let r=!1;if(e||t.sourceId===DataLayerSource.sourceId||t.sourceId===UrlQueryParamsSource.sourceId||t.sourceId===JSApiVariablesSource.sourceId||(r=!0),t.sourceId===DataLayerSource.sourceId){const e=t.arguments.find(e=>"dataLayerPropPath"===e.name);e&&e.value||(r=!0)}else{(!t.exampleValue||t.arguments&&!t.arguments.find(e=>e.value))&&(r=!0)}const o="tag-error";r?s.classList.add(o):s.classList.remove(o)}_handleContextEvents(e){var t;const s=null===(t=this.mergeTags)||void 0===t?void 0:t[e.key];s&&this.processSingleMergeTag(this.element.querySelector(`[cl-id="${s.id}"]`),s)}}
|
package/sdk/source/Source.d.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
import { SourceUpdateDataI } from '../context/ContextSDK';
|
|
2
|
+
export interface SubscriptionEntryI {
|
|
3
|
+
subscribe(cb: (data: SourceUpdateDataI) => void): void;
|
|
4
|
+
getValue(key?: string): any;
|
|
5
|
+
}
|
|
6
|
+
export interface SourceConfigI {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
1
9
|
export default class Source {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
config: {};
|
|
10
|
+
id: string;
|
|
11
|
+
subscriptionEntry: SubscriptionEntryI;
|
|
12
|
+
config: SourceConfigI;
|
|
6
13
|
subscribed: boolean;
|
|
7
|
-
|
|
8
|
-
|
|
14
|
+
constructor(id: string, subscriptionEntry: SubscriptionEntryI, config?: SourceConfigI);
|
|
15
|
+
subscribe(cb: (data: SourceUpdateDataI) => void): void;
|
|
16
|
+
getValue(key?: string): any;
|
|
9
17
|
isSubscribed(): boolean;
|
|
10
18
|
}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
import Source from "./Source";
|
|
2
|
+
import { UrlQueryParamsConfigI } from "./sources/UrlQueryParamsSource";
|
|
3
|
+
import { JSApiVariablesConfigI } from "./sources/JSApiVariablesSource";
|
|
4
|
+
import FormGroup from '../../form/FormGroup';
|
|
5
|
+
export interface SourceRegistryConfigI extends UrlQueryParamsConfigI, JSApiVariablesConfigI {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
1
8
|
export default class SourceRegistry {
|
|
2
|
-
|
|
3
|
-
|
|
9
|
+
registeredSourcesMap: {
|
|
10
|
+
[key: string]: Source;
|
|
11
|
+
};
|
|
4
12
|
sources: Source[];
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
13
|
+
constructor(form: FormGroup, config: SourceRegistryConfigI);
|
|
14
|
+
registerSource(source: Source): Source;
|
|
15
|
+
getSource(id: string): Source | undefined;
|
|
16
|
+
getSources(): Source[];
|
|
17
|
+
registerInitialSources(): Source[];
|
|
9
18
|
}
|
|
10
|
-
import Source from "./Source";
|
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
import DefaultEventEmitter from "@claspo/common/DefaultEventEmitter";
|
|
2
|
+
import { SourceUpdateDataI } from '../../context/ContextSDK';
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
dataLayer?: Array<Record<string, any> | any[]>;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export interface DataLayerModelI {
|
|
9
|
+
arguments?: DataLayerArgumentI[];
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
export interface DataLayerArgumentI {
|
|
13
|
+
name: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}
|
|
16
|
+
export interface DataLayerProcessorResultI {
|
|
17
|
+
processor: (ctx: any, model: DataLayerModelI) => string | any;
|
|
18
|
+
}
|
|
19
|
+
export default class DataLayerSource extends DefaultEventEmitter {
|
|
2
20
|
static sourceId: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} | {
|
|
9
|
-
processor: (ctx: any, model: any) => any;
|
|
10
|
-
};
|
|
21
|
+
constructor();
|
|
22
|
+
subscribe(cb: (data: SourceUpdateDataI) => void): void;
|
|
23
|
+
getValue(key?: string): DataLayerProcessorResultI | Record<string, never>;
|
|
24
|
+
static processModel(model: DataLayerModelI, returnRawValue?: boolean): string | any;
|
|
25
|
+
static getValueByPropPath(dataLayerEvent: Record<string, any>, propPathArray: string[], model: DataLayerModelI, returnRawValue?: boolean): string | any;
|
|
11
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import DefaultEventEmitter from"@claspo/common/DefaultEventEmitter";import isDictionary from"@claspo/common/object/isDictionary";import flatMap from"@claspo/common/utils/flatMap";function getPropPathArray(r){return r?flatMap(r.value.split(".").map(r=>r.trim()).map(r=>r.split(/[\[\]]/)),r=>r).filter(r=>!!r):[]}export default class DataLayerSource extends DefaultEventEmitter{constructor(){super()}subscribe(){}getValue(r){return r?{processor:(r,t)=>DataLayerSource.processModel(t)}:{}}static processModel(r,t){if(!r.arguments)return"";const e=r.arguments.find(r=>"dataLayerEventName"===r.name),a=r.arguments.find(r=>"dataLayerPropPath"===r.name),o=!!(null==e?void 0:e.value);if(!window.dataLayer)return"";let n;for(let i=window.dataLayer.length-1;i>=0;i--){const u=window.dataLayer[i];if(o){if((null==u?void 0:u.event)===e.value){n=u;break}if("event"===(null==u?void 0:u[0])&&(null==u?void 0:u[1])===e.value){n=u[2];break}}else{const e=getPropPathArray(a),o=DataLayerSource.getValueByPropPath(u,e,r,t);if(o)return o}}if(!n)return"";const i=getPropPathArray(a);return DataLayerSource.getValueByPropPath(n,i,r,t)}static getValueByPropPath(r,t,e,a){try{const e=t.reduce((r,t)=>{if(isDictionary(r)||Array.isArray(r))return r[t];throw new Error(`Tried to access non object data by propName "${t}". Data: ${r}`)},r);return Array.isArray(e)&&!a?e.join(", "):e}catch(r){return console.error("DataLayerSource: error while getting data by prop path. Model: ",e,"Error: ",r),""}}}DataLayerSource.sourceId="DATA_LAYER";
|
|
1
|
+
import DefaultEventEmitter from"@claspo/common/DefaultEventEmitter";import isDictionary from"@claspo/common/object/isDictionary";import flatMap from"@claspo/common/utils/flatMap";function getPropPathArray(r){return r?flatMap(r.value.split(".").map(r=>r.trim()).map(r=>r.split(/[\[\]]/)),r=>r).filter(r=>!!r):[]}export default class DataLayerSource extends DefaultEventEmitter{constructor(){super()}subscribe(r){}getValue(r){return r?{processor:(r,t)=>DataLayerSource.processModel(t)}:{}}static processModel(r,t){if(!r.arguments)return"";const e=r.arguments.find(r=>"dataLayerEventName"===r.name),a=r.arguments.find(r=>"dataLayerPropPath"===r.name),o=!!(null==e?void 0:e.value);if(!window.dataLayer)return"";let n;for(let i=window.dataLayer.length-1;i>=0;i--){const u=window.dataLayer[i];if(o){if((null==u?void 0:u.event)===e.value){n=u;break}if("event"===(null==u?void 0:u[0])&&(null==u?void 0:u[1])===e.value){n=u[2];break}}else{const e=getPropPathArray(a),o=DataLayerSource.getValueByPropPath(u,e,r,t);if(o)return o}}if(!n)return"";const i=getPropPathArray(a);return DataLayerSource.getValueByPropPath(n,i,r,t)}static getValueByPropPath(r,t,e,a){try{const e=t.reduce((r,t)=>{if(isDictionary(r)||Array.isArray(r))return r[t];throw new Error(`Tried to access non object data by propName "${t}". Data: ${r}`)},r);return Array.isArray(e)&&!a?e.join(", "):e}catch(r){return console.error("DataLayerSource: error while getting data by prop path. Model: ",e,"Error: ",r),""}}}DataLayerSource.sourceId="DATA_LAYER";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { SourceUpdateDataI } from '../../context/ContextSDK';
|
|
2
|
+
import FormGroup from '../../../form/FormGroup';
|
|
1
3
|
export default class FormSource {
|
|
2
|
-
|
|
3
|
-
formService:
|
|
4
|
-
subscribe(cb:
|
|
5
|
-
getValue(key
|
|
4
|
+
formService: FormGroup;
|
|
5
|
+
constructor(formService: FormGroup);
|
|
6
|
+
subscribe(cb: (data: SourceUpdateDataI) => void): void;
|
|
7
|
+
getValue(key?: string): string | Record<string, any> | undefined;
|
|
6
8
|
}
|
|
@@ -1,12 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
import DefaultEventEmitter from "@claspo/common/DefaultEventEmitter";
|
|
2
|
+
import { SourceUpdateDataI } from '../../context/ContextSDK';
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export interface JSApiVariablesModelI {
|
|
9
|
+
arguments?: JSApiVariablesArgumentI[];
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
export interface JSApiVariablesArgumentI {
|
|
13
|
+
name: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}
|
|
16
|
+
export interface JSApiVariablesConfigI {
|
|
17
|
+
instanceName?: string;
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
20
|
+
export interface JSApiVariablesProcessorResultI {
|
|
21
|
+
processor: (ctx: any, model: JSApiVariablesModelI) => string;
|
|
22
|
+
}
|
|
23
|
+
export default class JSApiVariablesSource extends DefaultEventEmitter {
|
|
2
24
|
static sourceId: string;
|
|
3
|
-
|
|
4
|
-
constructor(config?:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
processor?: undefined;
|
|
9
|
-
} | {
|
|
10
|
-
processor: (ctx: any, model: any) => any;
|
|
11
|
-
};
|
|
25
|
+
instanceName: string | undefined;
|
|
26
|
+
constructor(config?: JSApiVariablesConfigI);
|
|
27
|
+
subscribe(cb: (data: SourceUpdateDataI) => void): void;
|
|
28
|
+
getValue(key?: string): JSApiVariablesProcessorResultI | Record<string, never>;
|
|
29
|
+
static processModel(model: JSApiVariablesModelI, instanceName?: string): string;
|
|
12
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import DefaultEventEmitter from"@claspo/common/DefaultEventEmitter";export default class JSApiVariablesSource extends DefaultEventEmitter{constructor(e={}){super(),this.instanceName=e.instanceName}subscribe(){}getValue(e){return e?{processor:(e,r)=>JSApiVariablesSource.processModel(r,this.instanceName)}:{}}static processModel(e,r){var a;if(!e.arguments)return"";const t=e.arguments.find(e=>"JavaScriptVariable"===e.name);if(!(null==t?void 0:t.value)||!(null===(a=window[r])||void 0===a?void 0:a.variables))return"";try{return window[r].variables[t.value]||""}catch(r){return console.error("JSApiVariablesSource: error while getting variable. Model: ",e,"Error: ",r),""}}}JSApiVariablesSource.sourceId="JS_API_VARIABLE";
|
|
1
|
+
import DefaultEventEmitter from"@claspo/common/DefaultEventEmitter";export default class JSApiVariablesSource extends DefaultEventEmitter{constructor(e={}){super(),this.instanceName=e.instanceName}subscribe(e){}getValue(e){return e?{processor:(e,r)=>JSApiVariablesSource.processModel(r,this.instanceName)}:{}}static processModel(e,r){var a;if(!e.arguments)return"";const t=e.arguments.find(e=>"JavaScriptVariable"===e.name);if(!(null==t?void 0:t.value)||!r||!(null===(a=window[r])||void 0===a?void 0:a.variables))return"";try{return window[r].variables[t.value]||""}catch(r){return console.error("JSApiVariablesSource: error while getting variable. Model: ",e,"Error: ",r),""}}}JSApiVariablesSource.sourceId="JS_API_VARIABLE";
|
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
import DefaultEventEmitter from "@claspo/common/DefaultEventEmitter";
|
|
2
|
+
import { SourceUpdateDataI } from '../../context/ContextSDK';
|
|
3
|
+
export interface UrlQueryParamsModelI {
|
|
4
|
+
arguments?: UrlQueryParamsArgumentI[];
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export interface UrlQueryParamsArgumentI {
|
|
8
|
+
name: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
export interface UrlQueryParamsConfigI {
|
|
12
|
+
sessionUrlSearchParams?: string[];
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export interface UrlQueryParamsProcessorResultI {
|
|
16
|
+
processor: (ctx: any, model: UrlQueryParamsModelI) => string;
|
|
17
|
+
}
|
|
18
|
+
export default class UrlQueryParamsSource extends DefaultEventEmitter {
|
|
2
19
|
static sourceId: string;
|
|
3
|
-
|
|
4
|
-
constructor(config?:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
processor?: undefined;
|
|
9
|
-
} | {
|
|
10
|
-
processor: (ctx: any, model: any) => string;
|
|
11
|
-
};
|
|
20
|
+
config: UrlQueryParamsConfigI;
|
|
21
|
+
constructor(config?: UrlQueryParamsConfigI);
|
|
22
|
+
subscribe(cb: (data: SourceUpdateDataI) => void): void;
|
|
23
|
+
getValue(key?: string): UrlQueryParamsProcessorResultI | Record<string, never>;
|
|
24
|
+
static processModel(model: UrlQueryParamsModelI, sessionUrlSearchParams?: string[]): string;
|
|
12
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import DefaultEventEmitter from"@claspo/common/DefaultEventEmitter";export default class UrlQueryParamsSource extends DefaultEventEmitter{constructor(e={}){super(),this.config=e}subscribe(){}getValue(e){return e?{processor:(e,r)=>UrlQueryParamsSource.processModel(r,this.config.sessionUrlSearchParams)}:{}}static processModel(e,r){if(!e.arguments)return"";const t=e.arguments.find(e=>"urlQueryParamName"===e.name);if(!r){r=[new URL(window.location.href).search]}if(!t||!t.value)return"";let a;for(let e=r.length-1;e>=0;e--){const s=new URLSearchParams(r[e]).getAll(t.value).filter(Boolean);if(s.length){a=s;break}}return a?a.join(", "):""}}UrlQueryParamsSource.sourceId="URL_QUERY_PARAMS";
|
|
1
|
+
import DefaultEventEmitter from"@claspo/common/DefaultEventEmitter";export default class UrlQueryParamsSource extends DefaultEventEmitter{constructor(e={}){super(),this.config=e}subscribe(e){}getValue(e){return e?{processor:(e,r)=>UrlQueryParamsSource.processModel(r,this.config.sessionUrlSearchParams)}:{}}static processModel(e,r){if(!e.arguments)return"";const t=e.arguments.find(e=>"urlQueryParamName"===e.name);if(!r){r=[new URL(window.location.href).search]}if(!t||!t.value)return"";let a;for(let e=r.length-1;e>=0;e--){const s=new URLSearchParams(r[e]).getAll(t.value).filter(Boolean);if(s.length){a=s;break}}return a?a.join(", "):""}}UrlQueryParamsSource.sourceId="URL_QUERY_PARAMS";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export declare const REQUIRED_SYMBOL: unique symbol;
|
|
2
|
+
export declare function required(errorKey?: string): (value: any) => {
|
|
3
|
+
isValid: any;
|
|
4
|
+
errorKey: string;
|
|
4
5
|
};
|
|
5
|
-
export const REQUIRED_SYMBOL: unique symbol;
|
package/sdk.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import UpdatingEntryModule from "./UpdatingEntryModule";
|
|
2
2
|
import StaticEntryModule from "./StaticEntryModule";
|
|
3
|
-
import ViewRouter from "./ViewRouter";
|
|
4
3
|
import CompositionRoot from "./CompositionRoot";
|
|
5
|
-
import
|
|
4
|
+
import ViewRouter from "./ViewRouter";
|
|
6
5
|
import ViewEntryType from "./document-model/ViewEntryType";
|
|
7
|
-
import
|
|
6
|
+
import ComponentType from './sdk/ComponentType';
|
|
7
|
+
import { DocumentModelUpdateType } from "./document-model/DocumentModelService";
|
|
8
8
|
import { RenderConstants } from "./renderer/RenderConstants";
|
|
9
9
|
import { ViewRendererActionType } from "./renderer/ViewRendererActionType";
|
|
10
10
|
import { LoopAnimationStylesService } from "./renderer/style/LoopAnimationStylesService";
|
package/sdk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import UpdatingEntryModule from"./UpdatingEntryModule";import StaticEntryModule from"./StaticEntryModule";import CompositionRoot from"./CompositionRoot";import ViewRouter from"./ViewRouter";import ViewEntryType from"./document-model/ViewEntryType";import ComponentType from"./sdk/ComponentType";import{DocumentModelUpdateType}from"./document-model/
|
|
1
|
+
import UpdatingEntryModule from"./UpdatingEntryModule";import StaticEntryModule from"./StaticEntryModule";import CompositionRoot from"./CompositionRoot";import ViewRouter from"./ViewRouter";import ViewEntryType from"./document-model/ViewEntryType";import ComponentType from"./sdk/ComponentType";import{DocumentModelUpdateType}from"./document-model/DocumentModelService";import{RenderConstants}from"./renderer/RenderConstants";import{ViewRendererActionType}from"./renderer/ViewRendererActionType";import{LoopAnimationStylesService}from"./renderer/style/LoopAnimationStylesService";export{UpdatingEntryModule,StaticEntryModule,ViewRouter,CompositionRoot,ComponentType,ViewEntryType,DocumentModelUpdateType,RenderConstants,ViewRendererActionType,LoopAnimationStylesService};
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
export default class WcFactory {
|
|
2
|
+
state: any;
|
|
3
|
+
eventEmitter: any;
|
|
4
|
+
form: any;
|
|
5
|
+
documentModel: any;
|
|
6
|
+
resizeListener: any;
|
|
7
|
+
mobileDeviceOrientationListener: any;
|
|
8
|
+
config: any;
|
|
9
|
+
commonStylesService: any;
|
|
10
|
+
trackingService: any;
|
|
11
|
+
layoutType: any;
|
|
12
|
+
actionFactory: any;
|
|
13
|
+
actionRegister: any;
|
|
14
|
+
prizePoolFactory: any;
|
|
15
|
+
context: any;
|
|
16
|
+
mergeTagsProcessorFactory: any;
|
|
17
|
+
componentRegister: any;
|
|
18
|
+
htmlDocumentObject: any;
|
|
2
19
|
constructor({ state, eventEmitter, form, documentModel, resizeListener, config, commonStylesService, trackingService, layoutType, actionFactory, actionRegister, prizePoolFactory, context, mergeTagsProcessorFactory, mobileDeviceOrientationListener, componentRegister, htmlDocumentObject, }: {
|
|
3
20
|
state: any;
|
|
4
21
|
eventEmitter: any;
|
|
@@ -18,23 +35,6 @@ export default class WcFactory {
|
|
|
18
35
|
componentRegister: any;
|
|
19
36
|
htmlDocumentObject: any;
|
|
20
37
|
});
|
|
21
|
-
state: any;
|
|
22
|
-
eventEmitter: any;
|
|
23
|
-
form: any;
|
|
24
|
-
documentModel: any;
|
|
25
|
-
resizeListener: any;
|
|
26
|
-
mobileDeviceOrientationListener: any;
|
|
27
|
-
config: any;
|
|
28
|
-
commonStylesService: any;
|
|
29
|
-
trackingService: any;
|
|
30
|
-
layoutType: any;
|
|
31
|
-
actionFactory: any;
|
|
32
|
-
actionRegister: any;
|
|
33
|
-
prizePoolFactory: any;
|
|
34
|
-
context: any;
|
|
35
|
-
mergeTagsProcessorFactory: any;
|
|
36
|
-
componentRegister: any;
|
|
37
|
-
htmlDocumentObject: any;
|
|
38
38
|
create(componentModel: any, rendererType: any): any;
|
|
39
39
|
getComponentClass(componentModel: any, rendererType: any): any;
|
|
40
40
|
constructProps(model: any, viewResourceManager: any): {
|
package/wc-renderer/WcFactory.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import RenderMode from"@claspo/common/RenderMode";import{ComponentPropsExtractor}from"../document-model/ComponentPropsExtractor";import CommonStylesService from"../renderer/style/CommonStylesService";import{LoopAnimationStylesService}from"../renderer/style/LoopAnimationStylesService";import{applySysAttrPrefix}from"../renderer/RenderConstants";import ViewEntryType from"../document-model/ViewEntryType";export default class WcFactory{constructor({state:t,eventEmitter:e,form:o,documentModel:i,resizeListener:r,config:n,commonStylesService:s,trackingService:c,layoutType:m,actionFactory:y,actionRegister:a,prizePoolFactory:l,context:p,mergeTagsProcessorFactory:h,mobileDeviceOrientationListener:d,componentRegister:u,htmlDocumentObject:S}){this.state=t,this.eventEmitter=e,this.form=o,this.documentModel=i,this.resizeListener=r,this.mobileDeviceOrientationListener=d,this.config=n,this.commonStylesService=s,this.trackingService=c,this.layoutType=m,this.actionFactory=y,this.actionRegister=a,this.prizePoolFactory=l,this.context=p,this.mergeTagsProcessorFactory=h,this.componentRegister=u,this.htmlDocumentObject=S}create(t,e){let o=new(this.getComponentClass(t,e));const i=applySysAttrPrefix("content-container");if(t.type===ViewEntryType.VIEW&&"SysColumnsComponent"!==t.name){const t=document.createElement("div");t.setAttribute(i,""),t.style.display="inherit",t.style.gap="inherit",t.style.justifyContent="inherit",t.style.alignItems="inherit",t.style.flexDirection="inherit",t.style.width="100%",t.style.height="100%",o.getRootElement().appendChild(t),o.contentContainer=t}return o.setAttribute(applySysAttrPrefix("type"),t.type),o.setAttribute(applySysAttrPrefix("id"),t.id),o.setAttribute(applySysAttrPrefix("component"),t.name),o.setAttribute(applySysAttrPrefix("path"),t.path),o.setAttribute(applySysAttrPrefix("element"),"host"),t.props.floating&&o.setAttribute(applySysAttrPrefix("floating"),"true"),e===RenderMode.UPDATING&&this.commonStylesService.setStyles("* {cursor:pointer !important;} *:focus {outline: none !important;}"),this.processStyles(o.getHostElement(),o.getRootElement(),t,e),CommonStylesService.applyHostStyles(t.type,o,t,this.layoutType),o}getComponentClass(t,e){return this.componentRegister.getComponent(t.name,e)}constructProps(t,e){return{model:t,documentModel:this.documentModel,resizeListener:this.resizeListener,mobileDeviceOrientationListener:this.mobileDeviceOrientationListener,layoutType:this.layoutType,viewResourceManager:e,htmlDocumentObject:this.htmlDocumentObject,services:{state:this.state,eventEmitter:this.eventEmitter,form:this.form,config:this.config,trackingService:this.trackingService,actionFactory:this.actionFactory,actionRegister:this.actionRegister,prizePoolFactory:this.prizePoolFactory,context:this.context,mergeTagsProcessorFactory:this.mergeTagsProcessorFactory}}}processStyles(t,e,o,i){const r=this.commonStylesService.getStyles(),n=document.createElement("style");this.constructAnimationStyles(t,e,o,i),n.textContent=r,e.appendChild(n)}constructAnimationStyles(t,e,o,i){if(i===RenderMode.UPDATING)return;const r=LoopAnimationStylesService.constructAnimationStylesByTypes(ComponentPropsExtractor.extractLoopAnimationsFromStylesClasses(o));if(r){const i=document.createElement("style");i.textContent=r;[ViewEntryType.VIEW,ViewEntryType.CONTAINER,ViewEntryType.COLUMN,ViewEntryType.COLUMNS].includes(o.type)?t.appendChild(i):e.appendChild(i)}}}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { RenderModeT } from '@claspo/common/RenderMode';
|
|
2
|
+
import { ComponentClassI } from "./WcResolver";
|
|
3
|
+
export type DecoratorFnT = (clazz: ComponentClassI) => ComponentClassI;
|
|
4
|
+
export interface ModelNameToTagMapI {
|
|
5
|
+
[modelName: string]: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class WcRegister {
|
|
8
|
+
classes: ComponentClassI[];
|
|
9
|
+
modelNameToTagMap: ModelNameToTagMapI;
|
|
10
|
+
decorator: DecoratorFnT | null;
|
|
11
|
+
constructor(bundledComponentClasses?: ComponentClassI[]);
|
|
12
|
+
register(decorator: DecoratorFnT, renderMode: RenderModeT): void;
|
|
13
|
+
registerComponent(clazz: ComponentClassI, renderMode: RenderModeT): void;
|
|
14
|
+
getComponent(name: string, renderMode: RenderModeT): CustomElementConstructor;
|
|
15
|
+
getComponentTagName(tagName: string, renderMode: RenderModeT): string;
|
|
10
16
|
}
|
|
11
17
|
export default WcRegister;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import wcStaticDecorator from"./decorators/wcStaticDecorator";import wcUpdatingDecorator from"./decorators/wcUpdatingDecorator";import
|
|
1
|
+
import wcStaticDecorator from"./decorators/wcStaticDecorator";import wcUpdatingDecorator from"./decorators/wcUpdatingDecorator";import RenderMode from"@claspo/common/RenderMode";function getModelNameFromClass(e){return e.define.manifest.name}function getTagNameFromClass(e){const o=getModelNameFromClass(e);return(t=o,t.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,o)=>(o?"-":"")+e.toLowerCase())).replace("-component","");var t}export class WcRegister{constructor(e){this.classes=e||[],this.modelNameToTagMap=this.classes.reduce((e,o)=>Object.assign(Object.assign({},e),{[getModelNameFromClass(o)]:getTagNameFromClass(o)}),{}),this.decorator=null}register(e,o){this.decorator=e,this.classes.forEach(e=>this.registerComponent(e,o))}registerComponent(e,o){const t=this.getComponentTagName(getTagNameFromClass(e),o),a=o===RenderMode.STATIC?wcStaticDecorator(e):wcUpdatingDecorator(e);customElements.get(t)||customElements.define(t,a),this.modelNameToTagMap[getModelNameFromClass(a)]||(this.modelNameToTagMap[getModelNameFromClass(a)]=getTagNameFromClass(a))}getComponent(e,o){const t=(a=e,a.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,o)=>(o?"-":"")+e.toLowerCase())).replace("-component","");var a;const s=this.getComponentTagName(t,o),r=customElements.get(s);if(!r){const t=`Claspo: the component named "${e}" was found in the document model, but the component class was not found.`,a=o===RenderMode.STATIC?'Check if the component can be downloaded from the server, or pass the class to "bundledComponentClasses".':'Add the component to the "availableComponentsPanel", or pass the class to the "bundledComponentClasses".';throw new Error(`${t} ${a}`)}return r}getComponentTagName(e,o){return`${e}-${o.toLowerCase()}`}}export default WcRegister;
|
|
@@ -1,16 +1,27 @@
|
|
|
1
|
+
import { RenderModeT } from "@claspo/common/RenderMode";
|
|
2
|
+
import { WcRegister } from "./WcRegister";
|
|
3
|
+
import { ComponentManifestI } from '@claspo/common/component-manifest/ComponentManifest.interface';
|
|
4
|
+
import { ClDocumentI } from '@claspo/common/document/Document.interface';
|
|
5
|
+
export interface ComponentClassI {
|
|
6
|
+
define?: {
|
|
7
|
+
manifest: ComponentManifestI;
|
|
8
|
+
};
|
|
9
|
+
new (): HTMLElement;
|
|
10
|
+
}
|
|
11
|
+
export interface LoadComponentsResultI {
|
|
12
|
+
manifests: ComponentManifestI[];
|
|
13
|
+
}
|
|
1
14
|
export default class WcResolver {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
wcRegister:
|
|
5
|
-
getComponentManifests():
|
|
15
|
+
renderMode: RenderModeT;
|
|
16
|
+
wcRegister: WcRegister;
|
|
17
|
+
constructor(renderMode: RenderModeT, wcRegister: WcRegister);
|
|
18
|
+
getComponentManifests(): ComponentManifestI[];
|
|
6
19
|
getAllComponents(): (CustomElementConstructor | undefined)[];
|
|
7
|
-
loadComponentsIfNecessary(documentModel:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
getWindowKeyForComponentClass(componentName: any): string;
|
|
15
|
-
registerModules(modules: any): void;
|
|
20
|
+
loadComponentsIfNecessary(documentModel: ClDocumentI, staticResourcesUrl: string): Promise<LoadComponentsResultI>;
|
|
21
|
+
loadComponents(componentNames: string[], staticResourcesUrl: string): Promise<unknown[]>;
|
|
22
|
+
getComponentNamesToLoad(componentNames: string[] | null | undefined): string[];
|
|
23
|
+
buildComponentFilePaths(componentNames: string[], staticResourcesUrl: string): string[];
|
|
24
|
+
loadComponentClasses(modulePaths: string[], componentNamesToLoad: string[]): Promise<unknown[]>;
|
|
25
|
+
getWindowKeyForComponentClass(componentName: string): string;
|
|
26
|
+
registerModules(modules: unknown[]): void;
|
|
16
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import DocumentUtils from"@claspo/common/document/DocumentUtils";import
|
|
1
|
+
import DocumentUtils from"@claspo/common/document/DocumentUtils";import RenderMode from"@claspo/common/RenderMode";export default class WcResolver{constructor(e=RenderMode.STATIC,t){this.renderMode=e,this.wcRegister=t}getComponentManifests(){return this.getAllComponents().map(e=>{var t;return null===(t=e.define)||void 0===t?void 0:t.manifest}).filter(e=>!!e)}getAllComponents(){return Object.values(this.wcRegister.modelNameToTagMap).map(e=>this.wcRegister.getComponentTagName(e,this.renderMode)).map(e=>customElements.get(e)).filter(e=>!!e)}async loadComponentsIfNecessary(e,t){const o=new Set;e.views.forEach(e=>{DocumentUtils.iterateDepthFirst(e,e=>{o.add(e.name)})});const n=this.getComponentManifests(),s=n.map(e=>e.name),r=[...o].filter(e=>!s.includes(e));return r.length?(await this.loadComponents(r,t),{manifests:this.getComponentManifests()}):{manifests:n}}async loadComponents(e,t){const o=this.getComponentNamesToLoad(e),n=this.buildComponentFilePaths(o,t),s=await this.loadComponentClasses(n,o);return this.registerModules(s),s}getComponentNamesToLoad(e){return e||[]}buildComponentFilePaths(e,t){return e.map(e=>`${t.replace(/\/$/,"")}/${e}/${e}.js`)}loadComponentClasses(e,t){return Promise.all(e.map((e,o)=>new Promise((n,s)=>{const r=document.createElement("script");r.type="module",r.onload=()=>{const e=t[o];n(window[this.getWindowKeyForComponentClass(e)])},r.onerror=s,r.src=e,document.body.appendChild(r)})))}getWindowKeyForComponentClass(e){return`clComponentClass_${e}`}registerModules(e){e.forEach(e=>{this.wcRegister.registerComponent(e,this.renderMode)})}}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
export default class WcViewRenderer {
|
|
2
|
-
constructor(documentModel: any, resizeListener: any, configService: any, factory: any, eventEmitter: any);
|
|
3
2
|
isMobile: any;
|
|
4
3
|
resizeListener: any;
|
|
5
4
|
documentModel: any;
|
|
6
5
|
factory: any;
|
|
7
6
|
eventEmitter: any;
|
|
8
|
-
viewResourceManager:
|
|
7
|
+
viewResourceManager: any;
|
|
8
|
+
constructor(documentModel: any, resizeListener: any, configService: any, factory: any, eventEmitter: any);
|
|
9
|
+
render(viewModel: any, index: any, type?: "STATIC"): any;
|
|
9
10
|
destroy(viewComponentRef: any): void;
|
|
10
|
-
|
|
11
|
-
renderComponent(containerModel: any, model: any, rendererType: any, insertPosition?: any): any;
|
|
11
|
+
renderComponent(containerModel: any, model: any, rendererType: any, insertPosition?: string): any;
|
|
12
12
|
selectElementToAppendTo(element: any): any;
|
|
13
13
|
getRenderOutlet(element: any): any;
|
|
14
14
|
}
|
|
15
|
-
import ViewResourcesManager from "../resource-management/ViewResourcesManager";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import ComponentInsertType from"@claspo/common/document/ComponentInsertType";import ViewEntryType from"../document-model/ViewEntryType";import{ViewRendererActionType}from"../renderer/ViewRendererActionType";import{applySysAttrPrefix}from"../renderer/RenderConstants";import ViewResourcesManager from"../resource-management/ViewResourcesManager";import
|
|
1
|
+
import ComponentInsertType from"@claspo/common/document/ComponentInsertType";import ViewEntryType from"../document-model/ViewEntryType";import{ViewRendererActionType}from"../renderer/ViewRendererActionType";import{applySysAttrPrefix}from"../renderer/RenderConstants";import ViewResourcesManager from"../resource-management/ViewResourcesManager";import RenderMode from"@claspo/common/RenderMode";export default class WcViewRenderer{constructor(e,t,n,o,r){this.isMobile=null,this.resizeListener=t,this.documentModel=e,this.factory=o,this.eventEmitter=r,this.viewResourceManager=new ViewResourcesManager(this.eventEmitter),this.destroy=this.destroy.bind(this)}render(e,t,n=RenderMode.STATIC){const o=this.factory.create(e,n,this.viewResourceManager);if(this.documentModel.setComponentRef(e.id,o),e.componentRef=o,e.type===ViewEntryType.VIEW&&"SysColumnsComponent"===e.name){const t=applySysAttrPrefix("content-container"),n=this.getRenderOutlet(e.componentRef.getRootElement());null==n||n.setAttribute(t,"")}return e.children.forEach(t=>{this.renderComponent(e,t,n)}),setTimeout(()=>{this.viewResourceManager.viewHasPendingResources()||this.eventEmitter.emit(ViewRendererActionType.VIEW_COMPONENT_RESOURCES_LOADED)},5),o}destroy(e){var t;if(!(null===(t=e.model)||void 0===t?void 0:t.path))return;const n=e.model.path[0];this.documentModel.destroyView(n)}renderComponent(e,t,n,o=ComponentInsertType.INSIDE){var r;const i=this.factory.create(t,n,this.viewResourceManager);this.documentModel.setComponentRef(t.id,i);const s=e.componentRef.getRootElement();let c=t.props.floating||"FLOATING_IMAGE"===t.type?s:this.selectElementToAppendTo(e.componentRef.contentContainer)||this.selectElementToAppendTo(s);if(o===ComponentInsertType.INSIDE)i.connect(o,c,i);else if(o===ComponentInsertType.INSTEAD){const n=(null===(r=t.prevPath)||void 0===r?void 0:r.at(-1))<t.path.at(-1)?ComponentInsertType.AFTER:ComponentInsertType.BEFORE;i.connect(n,e.componentRef,t.componentRef)}else i.connect(o,e.componentRef,t.componentRef);return t.children&&t.children.forEach(e=>this.renderComponent(t,e,n)),t}selectElementToAppendTo(e){return e?this.getRenderOutlet(e)||e:null}getRenderOutlet(e){return e.querySelector(`[${applySysAttrPrefix("render-outlet")}]`)}}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
[x: string]: any;
|
|
7
|
-
};
|
|
1
|
+
import ComponentInsertType from "@claspo/common/document/ComponentInsertType";
|
|
2
|
+
import { ComponentClassI } from "../WcResolver";
|
|
3
|
+
export type ComponentInsertTypeT = typeof ComponentInsertType[keyof typeof ComponentInsertType];
|
|
4
|
+
export default function wcStaticDecorator<T extends ComponentClassI>(originComponentClass: T): T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import ComponentInsertType from"@claspo/common/document/ComponentInsertType";export default function wcStaticDecorator(e){return class extends e{connect(e,n,t){switch(e){case ComponentInsertType.INSIDE:return void n.appendChild(t);case ComponentInsertType.BEFORE:case ComponentInsertType.AFTER:{
|
|
1
|
+
import ComponentInsertType from"@claspo/common/document/ComponentInsertType";export default function wcStaticDecorator(e){return class extends e{connect(e,n,t){switch(e){case ComponentInsertType.INSIDE:return void n.appendChild(t);case ComponentInsertType.BEFORE:case ComponentInsertType.AFTER:{const o=e===ComponentInsertType.BEFORE?"beforebegin":"afterend";return void n.insertAdjacentElement(o,t)}}}}}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
export default function wcUpdatingDecorator(clazz: any): {
|
|
2
2
|
new (): {
|
|
3
3
|
[x: string]: any;
|
|
4
|
-
eventListeners: any
|
|
4
|
+
eventListeners: any;
|
|
5
5
|
lastDragOverEvent: any;
|
|
6
|
-
focusedElements: any
|
|
7
|
-
observer:
|
|
8
|
-
connectedCallback(): void;
|
|
9
|
-
disconnectedCallback(): void;
|
|
10
|
-
_addAllListeners(): void;
|
|
6
|
+
focusedElements: any;
|
|
7
|
+
observer: any;
|
|
11
8
|
removeFocusSubscription: any;
|
|
12
9
|
setFocusSubscription: any;
|
|
13
10
|
componentFocusedSubscription: any;
|
|
11
|
+
preHoveredElement: any;
|
|
12
|
+
connectedCallback(): void;
|
|
13
|
+
disconnectedCallback(): void;
|
|
14
|
+
_addAllListeners(): void;
|
|
14
15
|
_observeChanges(): void;
|
|
15
16
|
_setEventListeners(): void;
|
|
16
17
|
_removeListenersForDisconnectedNodes(): void;
|
|
@@ -27,7 +28,6 @@ export default function wcUpdatingDecorator(clazz: any): {
|
|
|
27
28
|
_elementDragOverListener(event: any): void;
|
|
28
29
|
_documentDropListener(event: any): void;
|
|
29
30
|
_mouseMoveEventListener(event: any): void;
|
|
30
|
-
preHoveredElement: any;
|
|
31
31
|
_mouseOutEventListener(event: any): void;
|
|
32
32
|
_blurEventListener(event: any): void;
|
|
33
33
|
_removeFocus(): void;
|
|
@@ -38,6 +38,6 @@ export default function wcUpdatingDecorator(clazz: any): {
|
|
|
38
38
|
_getElementNameByNode(node: any): any;
|
|
39
39
|
_setFocusableElementsAttribute(): void;
|
|
40
40
|
_updateFocusedElementClasses(): void;
|
|
41
|
-
connect(insertType: any, targetElement: any, instance: any): void;
|
|
42
41
|
};
|
|
42
|
+
[x: string]: any;
|
|
43
43
|
};
|
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
LIKE_DISLIKE: {
|
|
13
|
-
satisfied: string[];
|
|
14
|
-
dissatisfied: string[];
|
|
15
|
-
};
|
|
16
|
-
RATING_1_5: {
|
|
17
|
-
verySatisfied: string[];
|
|
18
|
-
satisfied: string[];
|
|
19
|
-
neutral: string[];
|
|
20
|
-
dissatisfied: string[];
|
|
21
|
-
veryDissatisfied: string[];
|
|
22
|
-
};
|
|
23
|
-
};
|
|
1
|
+
export type FeedbackIconTypeT = 'STAR_5' | 'EMOJI_3' | 'LIKE_DISLIKE' | 'RATING_1_5';
|
|
2
|
+
export type FeedbackIconStateT = 'selected' | 'unselected' | 'dissatisfied' | 'neutral' | 'satisfied' | 'verySatisfied' | 'veryDissatisfied';
|
|
3
|
+
export interface FeedbackIconSetI {
|
|
4
|
+
[key: string]: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface FeedbackIconsMapI {
|
|
7
|
+
[key: string]: FeedbackIconSetI;
|
|
8
|
+
}
|
|
9
|
+
export declare function getPredefinedIconsByType(type: FeedbackIconTypeT): FeedbackIconSetI;
|
|
10
|
+
export declare function getPredefinedIcons(): FeedbackIconsMapI;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
export type ObserverCallbackT = (...args: any[]) => void;
|
|
2
|
+
export interface ObserversI {
|
|
3
|
+
get(type: string): ObserverCallbackT[];
|
|
4
|
+
clear(): ObserversI;
|
|
5
|
+
}
|
|
6
|
+
declare const createObservers: (...types: string[]) => ObserversI;
|
|
1
7
|
export default createObservers;
|
|
2
|
-
declare function createObservers(...types: any[]): {
|
|
3
|
-
get: (type: any) => any;
|
|
4
|
-
clear: () => any;
|
|
5
|
-
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
subscriptions: any[];
|
|
3
|
-
push(subscription: any): void;
|
|
1
|
+
export interface SubscriptionI {
|
|
4
2
|
off(): void;
|
|
5
|
-
}
|
|
3
|
+
}
|
|
4
|
+
export interface SubscriptionsI {
|
|
5
|
+
push(subscription: SubscriptionI): void;
|
|
6
|
+
off(): void;
|
|
7
|
+
}
|
|
8
|
+
export default function createSubscriptions(): SubscriptionsI;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export const PRIMARY_PLATFORM: string;
|
|
1
|
+
export declare const PLATFORMS: {
|
|
2
|
+
DESKTOP: string;
|
|
3
|
+
MOBILE: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const PRIMARY_PLATFORM: string;
|