@chili-publish/studio-sdk 1.18.0 → 1.19.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/_bundles/main.js +1 -1
- package/_bundles/main.js.map +1 -1
- package/_bundles/report.html +2 -2
- package/lib/editor-engine.json +1 -1
- package/lib/package.json +1 -1
- package/lib/src/controllers/FrameController.d.ts +30 -9
- package/lib/src/controllers/FrameController.js +52 -10
- package/lib/src/controllers/FrameController.js.map +1 -1
- package/lib/src/controllers/LayoutController.d.ts +34 -2
- package/lib/src/controllers/LayoutController.js +49 -0
- package/lib/src/controllers/LayoutController.js.map +1 -1
- package/lib/src/controllers/SubscriberController.d.ts +13 -2
- package/lib/src/controllers/SubscriberController.js +53 -85
- package/lib/src/controllers/SubscriberController.js.map +1 -1
- package/lib/src/controllers/ToolController.d.ts +1 -1
- package/lib/src/controllers/ToolController.js +1 -1
- package/lib/src/controllers/UndoManagerController.d.ts +9 -0
- package/lib/src/controllers/UndoManagerController.js +12 -0
- package/lib/src/controllers/UndoManagerController.js.map +1 -1
- package/lib/src/controllers/UtilsController.d.ts +1 -1
- package/lib/src/controllers/UtilsController.js +1 -1
- package/lib/src/controllers/VariableController.d.ts +2 -2
- package/lib/src/controllers/VariableController.js.map +1 -1
- package/lib/src/index.d.ts +22 -21
- package/lib/src/index.js +11 -10
- package/lib/src/index.js.map +1 -1
- package/lib/src/interactions/{connector.d.ts → Connector.d.ts} +2 -0
- package/lib/src/interactions/{connector.js → Connector.js} +3 -1
- package/lib/src/interactions/{connector.js.map → Connector.js.map} +1 -1
- package/lib/src/next/NextInitiator.d.ts +2 -2
- package/lib/src/next/NextInitiator.js.map +1 -1
- package/lib/src/next/controllers/SubscriberController.d.ts +2 -2
- package/lib/src/next/controllers/SubscriberController.js +2 -4
- package/lib/src/next/controllers/SubscriberController.js.map +1 -1
- package/lib/src/next/tests/controllers/ConnectorController.test.js +1 -1
- package/lib/src/next/tests/controllers/ConnectorController.test.js.map +1 -1
- package/lib/src/next/tests/controllers/SubscriberContoller.test.js +5 -4
- package/lib/src/next/tests/controllers/SubscriberContoller.test.js.map +1 -1
- package/lib/src/next/types/NextSubscribers.d.ts +2 -1
- package/lib/src/sdk.d.ts +10 -10
- package/lib/src/sdk.js +24 -13
- package/lib/src/sdk.js.map +1 -1
- package/lib/src/tests/__mocks__/{animations.js → Animations.js} +1 -1
- package/lib/src/tests/__mocks__/Animations.js.map +1 -0
- package/lib/src/tests/__mocks__/{config.d.ts → Config.d.ts} +2 -2
- package/lib/src/tests/__mocks__/{config.js → Config.js} +5 -3
- package/lib/src/tests/__mocks__/Config.js.map +1 -0
- package/lib/src/tests/controllers/AnimationController.test.js +1 -1
- package/lib/src/tests/controllers/FrameController.test.js +29 -8
- package/lib/src/tests/controllers/FrameController.test.js.map +1 -1
- package/lib/src/tests/controllers/LayoutController.test.js +35 -0
- package/lib/src/tests/controllers/LayoutController.test.js.map +1 -1
- package/lib/src/tests/controllers/SubscriberContoller.test.js +46 -33
- package/lib/src/tests/controllers/SubscriberContoller.test.js.map +1 -1
- package/lib/src/tests/controllers/UndoManagerController.test.js +10 -1
- package/lib/src/tests/controllers/UndoManagerController.test.js.map +1 -1
- package/lib/src/tests/controllers/UtilsController.test.js +1 -1
- package/lib/src/tests/controllers/VariableController.test.js.map +1 -1
- package/lib/src/tests/index.test.js +1 -1
- package/lib/src/tests/interactions/{connector.test.js → Connector.test.js} +2 -2
- package/lib/src/tests/interactions/{connector.test.js.map → Connector.test.js.map} +1 -1
- package/lib/src/tests/utils/{editorResponseData.test.js → EditorResponseData.test.js} +1 -1
- package/lib/src/tests/utils/{editorResponseData.test.js.map → EditorResponseData.test.js.map} +1 -1
- package/lib/src/tests/utils/EventSubscription.test.js +238 -0
- package/lib/src/tests/utils/EventSubscription.test.js.map +1 -0
- package/lib/src/tests/utils/Logging.test.d.ts +1 -0
- package/lib/src/tests/utils/Logging.test.js +99 -0
- package/lib/src/tests/utils/Logging.test.js.map +1 -0
- package/lib/src/tests/utils/Round.test.d.ts +1 -0
- package/lib/src/tests/utils/{round.test.js → Round.test.js} +1 -1
- package/lib/src/tests/utils/{round.test.js.map → Round.test.js.map} +1 -1
- package/lib/src/types/CommonTypes.d.ts +226 -21
- package/lib/src/types/CommonTypes.js +27 -0
- package/lib/src/types/CommonTypes.js.map +1 -1
- package/lib/src/types/EngineEditModeTypes.d.ts +11 -0
- package/lib/src/types/EngineEditModeTypes.js +8 -0
- package/lib/src/types/EngineEditModeTypes.js.map +1 -0
- package/lib/src/types/FrameTypes.d.ts +16 -2
- package/lib/src/types/FrameTypes.js +15 -1
- package/lib/src/types/FrameTypes.js.map +1 -1
- package/lib/src/types/LayoutTypes.d.ts +3 -1
- package/lib/src/types/LayoutTypes.js.map +1 -1
- package/lib/src/types/VariableTypes.d.ts +1 -1
- package/lib/src/types/VariableTypes.js.map +1 -1
- package/lib/src/utils/ConfigHelper.d.ts +11 -0
- package/lib/src/utils/ConfigHelper.js +90 -0
- package/lib/src/utils/ConfigHelper.js.map +1 -0
- package/lib/src/utils/EngineCallbackHandler.d.ts +13 -0
- package/lib/src/utils/EngineCallbackHandler.js +23 -0
- package/lib/src/utils/EngineCallbackHandler.js.map +1 -0
- package/lib/src/utils/EngineEvent.d.ts +29 -0
- package/lib/src/utils/EngineEvent.js +44 -0
- package/lib/src/utils/EngineEvent.js.map +1 -0
- package/lib/src/utils/EngineEventTrigger.d.ts +8 -0
- package/lib/src/utils/EngineEventTrigger.js +33 -0
- package/lib/src/utils/EngineEventTrigger.js.map +1 -0
- package/lib/src/utils/{enums.js → Enums.js} +1 -1
- package/lib/src/utils/{enums.js.map → Enums.js.map} +1 -1
- package/package.json +1 -1
- package/lib/src/tests/__mocks__/animations.js.map +0 -1
- package/lib/src/tests/__mocks__/config.js.map +0 -1
- /package/lib/src/tests/__mocks__/{animations.d.ts → Animations.d.ts} +0 -0
- /package/lib/src/tests/interactions/{connector.test.d.ts → Connector.test.d.ts} +0 -0
- /package/lib/src/tests/utils/{editorResponseData.test.d.ts → EditorResponseData.test.d.ts} +0 -0
- /package/lib/src/tests/utils/{round.test.d.ts → EventSubscription.test.d.ts} +0 -0
- /package/lib/src/utils/{enums.d.ts → Enums.d.ts} +0 -0
package/lib/src/index.d.ts
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
import { SDK } from './sdk';
|
|
2
|
-
export { FramePropertyNames, LayoutPropertyNames, ToolType, DownloadFormats, EnvironmentType } from './utils/enums';
|
|
3
2
|
export { ConnectorHttpError } from './utils/EditorResponseData';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
3
|
+
export { DownloadFormats, EnvironmentType, FramePropertyNames, LayoutPropertyNames, ToolType } from './utils/Enums';
|
|
4
|
+
export { BasicAnimationsEmphasisStyles, EaseTypes, ShakeDirections, SlideDirections, TweenTypes, } from './types/AnimationTypes';
|
|
5
|
+
export { AnchorTargetEdgeType, AnchorTargetType, AutoGrowDirection, BarcodeSourceTypeEnum, BlendMode, FitMode, FitModePosition, FlowDirection, FrameAnchorType, FrameTypeEnum, ImageSourceTypeEnum, TextDirection, UpdateZIndexMethod, VerticalAlign, } from './types/FrameTypes';
|
|
6
|
+
export { LayoutIntent, LayoutType, MeasurementUnit, PositionEnum } from './types/LayoutTypes';
|
|
7
|
+
export { DocumentIssueTypeEnum, DocumentType } from './types/DocumentTypes';
|
|
8
8
|
export { ViewMode } from './types/ViewModeTypes';
|
|
9
|
-
export
|
|
10
|
-
export type {
|
|
11
|
-
export {
|
|
12
|
-
export
|
|
13
|
-
export {
|
|
14
|
-
export type { Color,
|
|
15
|
-
export type {
|
|
16
|
-
export type { FrameAnimationType, FrameAnimationPropertiesType, EaseTweenCombinationType, AnimationPlaybackType, BasicAnimationsType, } from './types/AnimationTypes';
|
|
17
|
-
export type { ConfigType, InitialStateType, PageType, EditorResponse, SelectedLayoutFrame, MetaData, Id, ConnectorConfigOptions, ConnectorConfigValue, } from './types/CommonTypes';
|
|
9
|
+
export { FrameAnchorTarget, PageAnchorTarget } from './types/FrameTypes';
|
|
10
|
+
export type { AnchorTarget, AutoGrowSettings, BarcodeFrame, BarcodeSource, BarcodeTextSource, BarcodeVariableSource, CenterFrameAnchor, EndFrameAnchor, Frame, FrameAnchor, FrameLayoutType, FrameType, ImageFrame, ImageFrameSource, ImageFrameUrlSource, ImageFrameVariableSource, RelativeFrameAnchor, ShapeFrame, StartAndEndFrameAnchor, StartFrameAnchor, TextFrame, } from './types/FrameTypes';
|
|
11
|
+
export type { FrameProperties, Layout, LayoutListItemType, LayoutPreset, LayoutPropertiesType, LayoutWithFrameProperties, } from './types/LayoutTypes';
|
|
12
|
+
export { Day, Locale, VariableType } from './types/VariableTypes';
|
|
13
|
+
export type { AbsoluteDate, BooleanVariable, ConnectorImageVariableSource, DateRestriction, DateVariable, GroupVariable, ImageVariable, ListVariable, ListVariableItem, LongTextVariable, NumberVariable, RelativeDate, ShortTextVariable, ValueWithStyle, Variable, } from './types/VariableTypes';
|
|
14
|
+
export type { Color, ColorUpdate, DocumentColor } from './types/ColorStyleTypes';
|
|
15
|
+
export type { AnimationPlaybackType, BasicAnimationsType, EaseTweenCombinationType, FrameAnimationPropertiesType, FrameAnimationType, } from './types/AnimationTypes';
|
|
18
16
|
export { ConnectorConfigValueType } from './types/CommonTypes';
|
|
19
|
-
export type {
|
|
20
|
-
export type {
|
|
17
|
+
export type { ConfigType, ConnectorConfigOptions, ConnectorConfigValue, EditorResponse, Id, InitialStateType, MetaData, PageType, SelectedLayoutFrame, PrivateData, } from './types/CommonTypes';
|
|
18
|
+
export type { ActionCircularDocumentIssue, ActionExecutionDocumentIssue, ActionRegisterDocumentIssue, DocumentError, DocumentIssue, FontLoadingDocumentIssue, OverflowDocumentIssue, } from './types/DocumentTypes';
|
|
19
|
+
export type { AppearanceProperties, DisplayColor, SelectedTextStyle, TextProperties, TextStyle, TextStyleUpdateType, UpdateStyleType, } from './types/TextStyleTypes';
|
|
21
20
|
export type { CharacterStyle, CharacterStyleUpdate } from './types/CharacterStyleTypes';
|
|
22
|
-
export type { ColorUsage, ColorUsageUpdate } from './types/ColorStyleTypes';
|
|
23
21
|
export { ColorUsageType } from './types/ColorStyleTypes';
|
|
24
|
-
export type {
|
|
25
|
-
export {
|
|
22
|
+
export type { ColorUsage, ColorUsageUpdate } from './types/ColorStyleTypes';
|
|
23
|
+
export type { ParagraphStyle, ParagraphStyleUpdate } from './types/ParagraphStyleTypes';
|
|
24
|
+
export type { AddDocumentFontFamily, AddDocumentFontStyle, DocumentFontFamily, DocumentFontStyle, } from './types/FontTypes';
|
|
26
25
|
export { ColorType } from './types/ColorStyleTypes';
|
|
27
|
-
export * from './types/MediaConnectorTypes';
|
|
28
|
-
export * from './types/FontConnectorTypes';
|
|
29
26
|
export * from './types/ConnectorTypes';
|
|
30
27
|
export * from './types/DataConnectorTypes';
|
|
28
|
+
export * from './types/FontConnectorTypes';
|
|
29
|
+
export * from './types/MediaConnectorTypes';
|
|
30
|
+
export { Alignment, Case, FontWeights, Scripting, SelectedTextStyles, SelectedTextStyleSections, TextPosition, } from './types/TextStyleTypes';
|
|
31
31
|
export { WellKnownConfigurationKeys } from './types/ConfigurationTypes';
|
|
32
32
|
export * from './types/ActionTypes';
|
|
33
33
|
export * from './types/ShapeTypes';
|
|
34
34
|
export * from './types/BarcodeTypes';
|
|
35
35
|
export type { Viewport } from './types/ViewportTypes';
|
|
36
36
|
export * from './types/PageTypes';
|
|
37
|
+
export * from './types/EngineEditModeTypes';
|
|
37
38
|
export default SDK;
|
package/lib/src/index.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { SDK } from './sdk';
|
|
2
|
-
export { FramePropertyNames, LayoutPropertyNames, ToolType, DownloadFormats, EnvironmentType } from './utils/enums';
|
|
3
2
|
export { ConnectorHttpError } from './utils/EditorResponseData';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
3
|
+
export { DownloadFormats, EnvironmentType, FramePropertyNames, LayoutPropertyNames, ToolType } from './utils/Enums';
|
|
4
|
+
export { BasicAnimationsEmphasisStyles, EaseTypes, ShakeDirections, SlideDirections, TweenTypes, } from './types/AnimationTypes';
|
|
5
|
+
export { AnchorTargetEdgeType, AnchorTargetType, AutoGrowDirection, BarcodeSourceTypeEnum, BlendMode, FitMode, FitModePosition, FlowDirection, FrameAnchorType, FrameTypeEnum, ImageSourceTypeEnum, TextDirection, UpdateZIndexMethod, VerticalAlign, } from './types/FrameTypes';
|
|
6
|
+
export { LayoutIntent, LayoutType, MeasurementUnit, PositionEnum } from './types/LayoutTypes';
|
|
7
|
+
export { DocumentIssueTypeEnum, DocumentType } from './types/DocumentTypes';
|
|
8
8
|
export { ViewMode } from './types/ViewModeTypes';
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
9
|
+
export { FrameAnchorTarget, PageAnchorTarget } from './types/FrameTypes';
|
|
10
|
+
export { Day, Locale, VariableType } from './types/VariableTypes';
|
|
11
11
|
export { ConnectorConfigValueType } from './types/CommonTypes';
|
|
12
12
|
export { ColorUsageType } from './types/ColorStyleTypes';
|
|
13
|
-
export { SelectedTextStyleSections, SelectedTextStyles, FontWeights, Alignment, TextPosition, Case, Scripting, } from './types/TextStyleTypes';
|
|
14
13
|
export { ColorType } from './types/ColorStyleTypes';
|
|
15
|
-
export * from './types/MediaConnectorTypes';
|
|
16
|
-
export * from './types/FontConnectorTypes';
|
|
17
14
|
export * from './types/ConnectorTypes';
|
|
18
15
|
export * from './types/DataConnectorTypes';
|
|
16
|
+
export * from './types/FontConnectorTypes';
|
|
17
|
+
export * from './types/MediaConnectorTypes';
|
|
18
|
+
export { Alignment, Case, FontWeights, Scripting, SelectedTextStyles, SelectedTextStyleSections, TextPosition, } from './types/TextStyleTypes';
|
|
19
19
|
export { WellKnownConfigurationKeys } from './types/ConfigurationTypes';
|
|
20
20
|
export * from './types/ActionTypes';
|
|
21
21
|
export * from './types/ShapeTypes';
|
|
22
22
|
export * from './types/BarcodeTypes';
|
|
23
23
|
export * from './types/PageTypes';
|
|
24
|
+
export * from './types/EngineEditModeTypes';
|
|
24
25
|
export default SDK;
|
|
25
26
|
//# sourceMappingURL=index.js.map
|
package/lib/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEpH,OAAO,EACH,6BAA6B,EAC7B,SAAS,EACT,eAAe,EACf,eAAe,EACf,UAAU,GACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACH,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,SAAS,EACT,OAAO,EACP,eAAe,EACf,aAAa,EACb,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,aAAa,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE9F,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAiCzE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AA4BlE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAkC/D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAWzD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EACH,SAAS,EACT,IAAI,EACJ,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,yBAAyB,EACzB,YAAY,GACf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAExE,cAAc,qBAAqB,CAAC;AAEpC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,sBAAsB,CAAC;AAIrC,cAAc,mBAAmB,CAAC;AAElC,cAAc,6BAA6B,CAAC;AAE5C,eAAe,GAAG,CAAC"}
|
|
@@ -41,6 +41,8 @@ interface ConfigParameterTypes {
|
|
|
41
41
|
onBarcodeValidationChanged: (validationResults: string) => void;
|
|
42
42
|
onDataSourceIdChanged: (connectorId?: Id) => void;
|
|
43
43
|
onDocumentIssueListChanged: (documentIssues: string) => void;
|
|
44
|
+
onCustomUndoDataChanged: (customData: string) => void;
|
|
45
|
+
onEngineEditModeChanged: (engineEditMode: string) => void;
|
|
44
46
|
}
|
|
45
47
|
declare const Connect: (editorLink: string, params: ConfigParameterTypes, setConnection: (connection: Connection) => void, editorId?: string, styling?: StudioStyling) => void;
|
|
46
48
|
export default Connect;
|
|
@@ -107,8 +107,10 @@ const Connect = (editorLink, params, setConnection, editorId = 'chili-editor', s
|
|
|
107
107
|
selectedPageIdChanged: params.onSelectedPageIdChanged,
|
|
108
108
|
dataSourceIdChanged: params.onDataSourceIdChanged,
|
|
109
109
|
documentIssueListChanged: params.onDocumentIssueListChanged,
|
|
110
|
+
customUndoDataChanged: params.onCustomUndoDataChanged,
|
|
111
|
+
engineEditingModeChanged: params.onEngineEditModeChanged,
|
|
110
112
|
},
|
|
111
113
|
}));
|
|
112
114
|
};
|
|
113
115
|
export default Connect;
|
|
114
|
-
//# sourceMappingURL=
|
|
116
|
+
//# sourceMappingURL=Connector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"Connector.js","sourceRoot":"","sources":["../../../src/interactions/Connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,cAAc,EAAE,MAAM,QAAQ,CAAC;AAIpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,UAAkB,EAAE,EAAE;IACrD,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC,kDAAkD,CAAC,CAAC;IACrF,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,IAAI,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;QAChC,IAAI,GAAG,UAAU,CAAC;KACrB;SAAM,IAAI,UAAU,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE;QAC/C,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;KACjD;SAAM,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QACtC,IAAI,GAAG,GAAG,UAAU,GAAG,CAAC;KAC3B;IACD,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAyB,EAAE,UAAkB,EAAE,OAAuB,EAAE,EAAE;IACjG,MAAM,IAAI,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IAClD,MAAM,IAAI,GAAG;;;;;mDAKkC,WAAW;;;;;2BAKnC,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E,MAAM,CAAC,iBAAiB;YACzC,wBAAwB,EAAE,MAAM,CAAC,0BAA0B;YAC3D,wBAAwB,EAAE,MAAM,CAAC,0BAA0B;YAC3D,UAAU,EAAE,MAAM,CAAC,YAAY;YAC/B,eAAe,EAAE,MAAM,CAAC,iBAAiB;YACzC,wBAAwB,EAAE,MAAM,CAAC,0BAA0B;YAC3D,qBAAqB,EAAE,MAAM,CAAC,uBAAuB;YACrD,mBAAmB,EAAE,MAAM,CAAC,qBAAqB;YACjD,wBAAwB,EAAE,MAAM,CAAC,0BAA0B;YAC3D,qBAAqB,EAAE,MAAM,CAAC,uBAAuB;YACrD,wBAAwB,EAAE,MAAM,CAAC,uBAAuB;SAC3D;KACJ,CAAC,CACL,CAAC;AACN,CAAC,CAAC;AACF,eAAe,OAAO,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Connection } from 'penpal';
|
|
2
|
-
import {
|
|
2
|
+
import { EditorAPI, RuntimeConfigType } from '../types/CommonTypes';
|
|
3
3
|
import { SubscriberController } from './controllers/SubscriberController';
|
|
4
4
|
import { VariableController } from './controllers/VariableController';
|
|
5
5
|
import { ConnectorController } from './controllers/ConnectorController';
|
|
@@ -27,5 +27,5 @@ export declare class NextInitiator {
|
|
|
27
27
|
* The SDK should be configured clientside and it exposes all controllers to work with in other applications
|
|
28
28
|
* @param config The configuration object where the SDK and editor can get configured
|
|
29
29
|
*/
|
|
30
|
-
constructor(config:
|
|
30
|
+
constructor(config: RuntimeConfigType, connection: Connection, editorAPI: EditorAPI);
|
|
31
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextInitiator.js","sourceRoot":"","sources":["../../../src/next/NextInitiator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE;;;;;;;;GAQG;AACH,MAAM,OAAO,aAAa;IAatB;;;;OAIG;IACH,YAAY,
|
|
1
|
+
{"version":3,"file":"NextInitiator.js","sourceRoot":"","sources":["../../../src/next/NextInitiator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE;;;;;;;;GAQG;AACH,MAAM,OAAO,aAAa;IAatB;;;;OAIG;IACH,YAAY,MAAyB,EAAE,UAAsB,EAAE,SAAoB;QAC/E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAE3B,IAAI,CAAC,UAAU,GAAG,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC;QACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACvD,IAAI,CAAC,SAAS,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;CACJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RuntimeConfigType } from '../../types/CommonTypes';
|
|
2
2
|
/**
|
|
3
3
|
* The SubscriberController is responsible for all listeners which can influence the application-state from outside.
|
|
4
4
|
* Callbacks inside this controller can be set by `window.SDK.subscriber.{method-name}`
|
|
@@ -11,7 +11,7 @@ export declare class SubscriberController {
|
|
|
11
11
|
/**
|
|
12
12
|
* @ignore
|
|
13
13
|
*/
|
|
14
|
-
constructor(config:
|
|
14
|
+
constructor(config: RuntimeConfigType);
|
|
15
15
|
/**
|
|
16
16
|
* Listener on when variables change
|
|
17
17
|
* @param variablesJson Stringified array of Variable
|
|
@@ -12,16 +12,14 @@ export class SubscriberController {
|
|
|
12
12
|
* @param variablesJson Stringified array of Variable
|
|
13
13
|
*/
|
|
14
14
|
this.onVariableListChanged = (variablesJson) => {
|
|
15
|
-
|
|
16
|
-
callBack && callBack(JSON.parse(variablesJson));
|
|
15
|
+
this.config.events.onVariableListChanged.trigger(JSON.parse(variablesJson));
|
|
17
16
|
};
|
|
18
17
|
/**
|
|
19
18
|
* Listener on connectors, if this changes, this listener will get triggered with the updates
|
|
20
19
|
* @param connectors Stringified array of ConnectorInstance type
|
|
21
20
|
*/
|
|
22
21
|
this.onConnectorsChanged = (connectors) => {
|
|
23
|
-
|
|
24
|
-
callBack && callBack(JSON.parse(connectors));
|
|
22
|
+
this.config.events.onConnectorsChanged.trigger(JSON.parse(connectors));
|
|
25
23
|
};
|
|
26
24
|
this.config = config;
|
|
27
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriberController.js","sourceRoot":"","sources":["../../../../src/next/controllers/SubscriberController.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,oBAAoB;IAM7B;;OAEG;IACH,YAAY,
|
|
1
|
+
{"version":3,"file":"SubscriberController.js","sourceRoot":"","sources":["../../../../src/next/controllers/SubscriberController.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,oBAAoB;IAM7B;;OAEG;IACH,YAAY,MAAyB;QAIrC;;;WAGG;QACH,0BAAqB,GAAG,CAAC,aAAqB,EAAE,EAAE;YAC9C,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QAChF,CAAC,CAAC;QAEF;;;WAGG;QACH,wBAAmB,GAAG,CAAC,UAAkB,EAAE,EAAE;YACzC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;QAC3E,CAAC,CAAC;QAjBE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;CAiBJ"}
|
|
@@ -25,7 +25,7 @@ beforeEach(() => {
|
|
|
25
25
|
afterEach(() => {
|
|
26
26
|
jest.restoreAllMocks();
|
|
27
27
|
});
|
|
28
|
-
describe('ConnectorController', () => {
|
|
28
|
+
describe('Next.ConnectorController', () => {
|
|
29
29
|
const connectorId = 'dam';
|
|
30
30
|
it('Should call the getById method', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
31
|
yield mockedConnectorController.getById(connectorId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectorController.test.js","sourceRoot":"","sources":["../../../../../src/next/tests/controllers/ConnectorController.test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAI5E,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAChG,OAAO,EAGH,2BAA2B,EAC3B,aAAa,GAEhB,MAAM,4BAA4B,CAAC;AAEpC,IAAI,yBAA8C,CAAC;AAEnD,MAAM,aAAa,GAAc;IAC7B,gBAAgB,EAAE,GAAS,EAAE,kDAAC,OAAA,qBAAqB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAA,GAAA;IAC/E,aAAa,EAAE,GAAS,EAAE,kDAAC,OAAA,qBAAqB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAA,GAAA;IAC5E,iBAAiB,EAAE,GAAS,EAAE,kDAAC,OAAA,qBAAqB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAA,GAAA;CACnF,CAAC;AAEF,UAAU,CAAC,GAAG,EAAE;IACZ,yBAAyB,GAAG,IAAI,mBAAmB,CAAC,aAAa,CAAC,CAAC;IACnE,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;IAC9C,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IAC3C,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,GAAG,EAAE;IACX,IAAI,CAAC,eAAe,EAAE,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"ConnectorController.test.js","sourceRoot":"","sources":["../../../../../src/next/tests/controllers/ConnectorController.test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAI5E,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAChG,OAAO,EAGH,2BAA2B,EAC3B,aAAa,GAEhB,MAAM,4BAA4B,CAAC;AAEpC,IAAI,yBAA8C,CAAC;AAEnD,MAAM,aAAa,GAAc;IAC7B,gBAAgB,EAAE,GAAS,EAAE,kDAAC,OAAA,qBAAqB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAA,GAAA;IAC/E,aAAa,EAAE,GAAS,EAAE,kDAAC,OAAA,qBAAqB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAA,GAAA;IAC5E,iBAAiB,EAAE,GAAS,EAAE,kDAAC,OAAA,qBAAqB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAA,GAAA;CACnF,CAAC;AAEF,UAAU,CAAC,GAAG,EAAE;IACZ,yBAAyB,GAAG,IAAI,mBAAmB,CAAC,aAAa,CAAC,CAAC;IACnE,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;IAC9C,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IAC3C,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC;AACnD,C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CAAC,CAAC;QACjE,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC;IACvG,CAAC,CAAA,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,GAAS,EAAE;QAC9D,MAAM,oBAAoB,GAA+B;YACrD,GAAG,EAAE,cAAc;YACnB,MAAM,EAAE,2BAA2B,CAAC,KAAK;SAC5C,CAAC;QAEF,MAAM,yBAAyB,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;QAC/D,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACjE,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC;IACvG,CAAC,CAAA,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,GAAS,EAAE;QAC9D,MAAM,iBAAiB,GAA+B;YAClD,EAAE,EAAE,UAAU;YACd,MAAM,EAAE,2BAA2B,CAAC,KAAK;SAC5C,CAAC;QAEF,MAAM,yBAAyB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QAE5D,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACjE,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACpG,CAAC,CAAA,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
import { ConfigHelper } from '../../../utils/ConfigHelper';
|
|
10
11
|
import { castToEditorResponse, getEditorResponseData } from '../../../utils/EditorResponseData';
|
|
11
12
|
import { SubscriberController } from '../../controllers/SubscriberController';
|
|
12
13
|
import { ConnectorRegistrationSource } from '../../types/ConnectorTypes';
|
|
@@ -17,26 +18,26 @@ const mockEditorApi = {
|
|
|
17
18
|
onConnectorsChanged: () => __awaiter(void 0, void 0, void 0, function* () { return getEditorResponseData(castToEditorResponse(null)); }),
|
|
18
19
|
};
|
|
19
20
|
beforeEach(() => {
|
|
20
|
-
mockedSubscriberController = new SubscriberController(mockEditorApi);
|
|
21
21
|
jest.spyOn(mockEditorApi, 'onVariableListChanged');
|
|
22
22
|
jest.spyOn(mockEditorApi, 'onConnectorsChanged');
|
|
23
|
+
mockedSubscriberController = new SubscriberController(ConfigHelper.createRuntimeConfig(mockEditorApi));
|
|
23
24
|
});
|
|
24
25
|
afterEach(() => {
|
|
25
26
|
jest.restoreAllMocks();
|
|
26
27
|
});
|
|
27
|
-
describe('SubscriberController', () => {
|
|
28
|
+
describe('Next.SubscriberController', () => {
|
|
28
29
|
it('Should be possible to subscribe to onVariableListChanged', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
30
|
const variables = [
|
|
30
31
|
{ id: '1', type: VariableType.group },
|
|
31
32
|
{ id: 'varList', type: VariableType.list, selected: 'Orange', items: ['Apple', 'Pear', 'Orange'] },
|
|
32
33
|
];
|
|
33
|
-
mockedSubscriberController.onVariableListChanged(JSON.stringify(variables));
|
|
34
|
+
yield mockedSubscriberController.onVariableListChanged(JSON.stringify(variables));
|
|
34
35
|
expect(mockEditorApi.onVariableListChanged).toHaveBeenCalledWith(variables);
|
|
35
36
|
expect(mockEditorApi.onVariableListChanged).toHaveBeenCalledTimes(1);
|
|
36
37
|
}));
|
|
37
38
|
it('Should be possible to subscribe to onConnectorsChanged', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
39
|
const connectors = [{ id: 'id', name: 'name', source: ConnectorRegistrationSource.local }];
|
|
39
|
-
mockedSubscriberController.onConnectorsChanged(JSON.stringify(connectors));
|
|
40
|
+
yield mockedSubscriberController.onConnectorsChanged(JSON.stringify(connectors));
|
|
40
41
|
expect(mockEditorApi.onConnectorsChanged).toHaveBeenCalledWith(connectors);
|
|
41
42
|
expect(mockEditorApi.onConnectorsChanged).toHaveBeenCalledTimes(1);
|
|
42
43
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriberContoller.test.js","sourceRoot":"","sources":["../../../../../src/next/tests/controllers/SubscriberContoller.test.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,IAAI,0BAAgD,CAAC;AAErD,MAAM,aAAa,GAAc;IAC7B,qBAAqB,EAAE,GAAS,EAAE,kDAAC,OAAA,qBAAqB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAA,GAAA;IACpF,mBAAmB,EAAE,GAAS,EAAE,kDAAC,OAAA,qBAAqB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAA,GAAA;CACrF,CAAC;AAEF,UAAU,CAAC,GAAG,EAAE;IACZ,
|
|
1
|
+
{"version":3,"file":"SubscriberContoller.test.js","sourceRoot":"","sources":["../../../../../src/next/tests/controllers/SubscriberContoller.test.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE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CAAC;QAC5E,MAAM,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC,CAAA,CAAC,CAAC;IAEH,EAAE,CAAC,wDAAwD,EAAE,GAAS,EAAE;QACpE,MAAM,UAAU,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,2BAA2B,CAAC,KAAK,EAAE,CAAC,CAAC;QAE3F,MAAM,0BAA0B,CAAC,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;QACjF,MAAM,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;QAC3E,MAAM,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACvE,CAAC,CAAA,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/lib/src/sdk.d.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { Connection } from 'penpal';
|
|
2
|
-
import type { ConfigType, EditorAPI } from './types/CommonTypes';
|
|
2
|
+
import type { ConfigType, EditorAPI, RuntimeConfigType } from './types/CommonTypes';
|
|
3
3
|
import { ActionController } from './controllers/ActionController';
|
|
4
4
|
import { AnimationController } from './controllers/AnimationController';
|
|
5
|
+
import { BarcodeController } from './controllers/BarcodeController';
|
|
5
6
|
import { CanvasController } from './controllers/CanvasController';
|
|
6
7
|
import { CharacterStyleController } from './controllers/CharacterStyleController';
|
|
7
|
-
import {
|
|
8
|
+
import { ClipboardController } from './controllers/ClipboardController';
|
|
8
9
|
import { ColorConversionController } from './controllers/ColorConversionController';
|
|
10
|
+
import { ColorStyleController } from './controllers/ColorStyleController';
|
|
11
|
+
import { ConfigurationController } from './controllers/ConfigurationController';
|
|
9
12
|
import { ConnectorController } from './controllers/ConnectorController';
|
|
13
|
+
import { DataConnectorController } from './controllers/DataConnectorController';
|
|
14
|
+
import { DataSourceController } from './controllers/DataSourceController';
|
|
10
15
|
import { DebugController } from './controllers/DebugController';
|
|
11
16
|
import { DocumentController } from './controllers/DocumentController';
|
|
12
17
|
import { ExperimentController } from './controllers/ExperimentController';
|
|
13
18
|
import { FontConnectorController } from './controllers/FontConnectorController';
|
|
14
19
|
import { FontController } from './controllers/FontController';
|
|
15
20
|
import { FrameController } from './controllers/FrameController';
|
|
21
|
+
import { InfoController } from './controllers/InfoController';
|
|
16
22
|
import { LayoutController } from './controllers/LayoutController';
|
|
17
23
|
import { MediaConnectorController } from './controllers/MediaConnectorController';
|
|
18
24
|
import { PageController } from './controllers/PageController';
|
|
19
25
|
import { ParagraphStyleController } from './controllers/ParagraphStyleController';
|
|
26
|
+
import { ShapeController } from './controllers/ShapeController';
|
|
20
27
|
import { TextStyleController } from './controllers/TextStyleController';
|
|
21
28
|
import { ToolController } from './controllers/ToolController';
|
|
22
29
|
import { UndoManagerController } from './controllers/UndoManagerController';
|
|
23
30
|
import { UtilsController } from './controllers/UtilsController';
|
|
24
31
|
import { VariableController } from './controllers/VariableController';
|
|
25
|
-
import { ShapeController } from './controllers/ShapeController';
|
|
26
|
-
import { InfoController } from './controllers/InfoController';
|
|
27
|
-
import { ClipboardController } from './controllers/ClipboardController';
|
|
28
|
-
import { BarcodeController } from './controllers/BarcodeController';
|
|
29
32
|
import { NextInitiator } from './next/NextInitiator';
|
|
30
|
-
import { ConfigurationController } from './controllers/ConfigurationController';
|
|
31
|
-
import { DataConnectorController } from './controllers/DataConnectorController';
|
|
32
|
-
import { DataSourceController } from './controllers/DataSourceController';
|
|
33
33
|
export declare class SDK {
|
|
34
|
-
config:
|
|
34
|
+
config: RuntimeConfigType;
|
|
35
35
|
connection: Connection;
|
|
36
36
|
/**
|
|
37
37
|
* @ignore
|
package/lib/src/sdk.js
CHANGED
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
import Connect from './interactions/connector';
|
|
2
|
-
import { defaultStudioOptions, WellKnownConfigurationKeys } from './types/ConfigurationTypes';
|
|
3
|
-
import packageInfo from '../package.json';
|
|
4
1
|
import engineInfo from '../editor-engine.json';
|
|
2
|
+
import packageInfo from '../package.json';
|
|
3
|
+
import Connect from './interactions/Connector';
|
|
4
|
+
import { defaultStudioOptions, WellKnownConfigurationKeys } from './types/ConfigurationTypes';
|
|
5
5
|
import { DocumentType } from './types/DocumentTypes';
|
|
6
6
|
import { ActionController } from './controllers/ActionController';
|
|
7
7
|
import { AnimationController } from './controllers/AnimationController';
|
|
8
|
+
import { BarcodeController } from './controllers/BarcodeController';
|
|
8
9
|
import { CanvasController } from './controllers/CanvasController';
|
|
9
10
|
import { CharacterStyleController } from './controllers/CharacterStyleController';
|
|
10
|
-
import {
|
|
11
|
+
import { ClipboardController } from './controllers/ClipboardController';
|
|
11
12
|
import { ColorConversionController } from './controllers/ColorConversionController';
|
|
13
|
+
import { ColorStyleController } from './controllers/ColorStyleController';
|
|
12
14
|
import { ConnectorController } from './controllers/ConnectorController';
|
|
15
|
+
import { DataConnectorController } from './controllers/DataConnectorController';
|
|
16
|
+
import { DataSourceController } from './controllers/DataSourceController';
|
|
13
17
|
import { DebugController } from './controllers/DebugController';
|
|
14
18
|
import { DocumentController } from './controllers/DocumentController';
|
|
15
19
|
import { ExperimentController } from './controllers/ExperimentController';
|
|
16
20
|
import { FontConnectorController } from './controllers/FontConnectorController';
|
|
17
21
|
import { FontController } from './controllers/FontController';
|
|
18
22
|
import { FrameController } from './controllers/FrameController';
|
|
23
|
+
import { InfoController } from './controllers/InfoController';
|
|
19
24
|
import { LayoutController } from './controllers/LayoutController';
|
|
20
25
|
import { MediaConnectorController } from './controllers/MediaConnectorController';
|
|
21
26
|
import { PageController } from './controllers/PageController';
|
|
22
27
|
import { ParagraphStyleController } from './controllers/ParagraphStyleController';
|
|
28
|
+
import { ShapeController } from './controllers/ShapeController';
|
|
23
29
|
import { SubscriberController } from './controllers/SubscriberController';
|
|
24
30
|
import { TextStyleController } from './controllers/TextStyleController';
|
|
25
31
|
import { ToolController } from './controllers/ToolController';
|
|
26
32
|
import { UndoManagerController } from './controllers/UndoManagerController';
|
|
27
33
|
import { UtilsController } from './controllers/UtilsController';
|
|
28
34
|
import { VariableController } from './controllers/VariableController';
|
|
29
|
-
import { ShapeController } from './controllers/ShapeController';
|
|
30
|
-
import { InfoController } from './controllers/InfoController';
|
|
31
|
-
import { ClipboardController } from './controllers/ClipboardController';
|
|
32
|
-
import { BarcodeController } from './controllers/BarcodeController';
|
|
33
35
|
import { NextInitiator } from './next/NextInitiator';
|
|
34
|
-
import {
|
|
35
|
-
import { DataConnectorController } from './controllers/DataConnectorController';
|
|
36
|
+
import { ConfigHelper } from './utils/ConfigHelper';
|
|
36
37
|
import { DataItemMappingTools } from './utils/DataItemMappingTools';
|
|
37
|
-
import {
|
|
38
|
+
import { LocalConfigurationDecorator } from './utils/LocalConfigurationDecorator';
|
|
38
39
|
let connection;
|
|
39
40
|
const FIXED_EDITOR_LINK = 'https://studio-cdn.chiligrafx.com/editor/' + engineInfo.current + '/web';
|
|
40
41
|
export class SDK {
|
|
@@ -83,7 +84,15 @@ export class SDK {
|
|
|
83
84
|
onSelectedLayoutIdChanged: this.subscriber.onSelectedLayoutIdChanged,
|
|
84
85
|
onLayoutsChanged: this.subscriber.onLayoutsChanged,
|
|
85
86
|
onConnectorEvent: this.subscriber.onConnectorEvent,
|
|
86
|
-
onConnectorsChanged:
|
|
87
|
+
onConnectorsChanged: (state) => {
|
|
88
|
+
var _a;
|
|
89
|
+
if ((_a = this.enabledNextSubscribers) === null || _a === void 0 ? void 0 : _a.onConnectorsChanged) {
|
|
90
|
+
this.next.subscriber.onConnectorsChanged(state);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
this.subscriber.onConnectorsChanged(state);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
87
96
|
onZoomChanged: this.subscriber.onZoomChanged,
|
|
88
97
|
onSelectedPageIdChanged: this.subscriber.onSelectedPageIdChanged,
|
|
89
98
|
onPagesChanged: this.subscriber.onPagesChanged,
|
|
@@ -96,6 +105,8 @@ export class SDK {
|
|
|
96
105
|
onBarcodeValidationChanged: this.subscriber.onBarcodeValidationChanged,
|
|
97
106
|
onDataSourceIdChanged: this.subscriber.onDataSourceIdChanged,
|
|
98
107
|
onDocumentIssueListChanged: this.subscriber.onDocumentIssueListChanged,
|
|
108
|
+
onCustomUndoDataChanged: this.subscriber.onCustomUndoDataChanged,
|
|
109
|
+
onEngineEditModeChanged: this.subscriber.onEngineEditModeChanged,
|
|
99
110
|
}, this.setConnection, this.config.editorId, this.config.studioStyling);
|
|
100
111
|
this.editorAPI = connection === null || connection === void 0 ? void 0 : connection.promise.then((editorAPI) => {
|
|
101
112
|
return editorAPI;
|
|
@@ -146,7 +157,7 @@ export class SDK {
|
|
|
146
157
|
this.setConnection = (newConnection) => {
|
|
147
158
|
connection = newConnection;
|
|
148
159
|
};
|
|
149
|
-
this.config = config;
|
|
160
|
+
this.config = ConfigHelper.createRuntimeConfig(config);
|
|
150
161
|
this.connection = connection;
|
|
151
162
|
this.editorAPI = connection === null || connection === void 0 ? void 0 : connection.promise.then((child) => {
|
|
152
163
|
return child;
|
package/lib/src/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,OAAO,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAG9F,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MA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animations.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAuB;IAClD,SAAS,EAAE;QACP,EAAE,EAAE,GAAG;QACP,IAAI,EAAE,CAAC;QACP,EAAE,EAAE,CAAC;QACL,eAAe,EAAE,EAAE;KACtB;IACD,UAAU,EAAE,IAAI;CACnB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="jest" />
|
|
2
|
-
import {
|
|
2
|
+
import { RuntimeConfigType } from '../../types/CommonTypes';
|
|
3
3
|
export declare const defaultMockReturn: jest.Mock<any, any>;
|
|
4
|
-
declare const mockConfig:
|
|
4
|
+
declare const mockConfig: RuntimeConfigType;
|
|
5
5
|
export default mockConfig;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DocumentType } from '../../types/DocumentTypes';
|
|
2
|
+
import { ConfigHelper } from '../../utils/ConfigHelper';
|
|
2
3
|
export const defaultMockReturn = jest.fn().mockResolvedValue({ success: true, status: 0 });
|
|
3
|
-
const mockConfig = {
|
|
4
|
+
const mockConfig = ConfigHelper.createRuntimeConfig({
|
|
4
5
|
onActionsChanged: defaultMockReturn,
|
|
5
6
|
onStateChanged: defaultMockReturn,
|
|
6
7
|
onAuthExpired: defaultMockReturn,
|
|
@@ -19,6 +20,7 @@ const mockConfig = {
|
|
|
19
20
|
onVariableListChanged: defaultMockReturn,
|
|
20
21
|
onSelectedToolChanged: defaultMockReturn,
|
|
21
22
|
onUndoStackStateChanged: jest.fn().mockResolvedValue({ success: true, status: 0 }),
|
|
23
|
+
onCustomUndoDataChanged: defaultMockReturn,
|
|
22
24
|
onSelectedLayoutFramesChanged: defaultMockReturn,
|
|
23
25
|
onSelectedTextStyleChanged: defaultMockReturn,
|
|
24
26
|
onColorsChanged: defaultMockReturn,
|
|
@@ -33,6 +35,6 @@ const mockConfig = {
|
|
|
33
35
|
onPagesChanged: defaultMockReturn,
|
|
34
36
|
onPageSizeChanged: defaultMockReturn,
|
|
35
37
|
onViewModeChanged: defaultMockReturn,
|
|
36
|
-
};
|
|
38
|
+
});
|
|
37
39
|
export default mockConfig;
|
|
38
|
-
//# sourceMappingURL=
|
|
40
|
+
//# sourceMappingURL=Config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../../../src/tests/__mocks__/Config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;AAE3F,MAAM,UAAU,GAAsB,YAAY,CAAC,mBAAmB,CAAC;IACnE,gBAAgB,EAAE,iBAAiB;IACnC,cAAc,EAAE,iBAAiB;IACjC,aAAa,EAAE,iBAAiB;IAChC,mBAAmB,EAAE,iBAAiB;IACtC,gBAAgB,EAAE,iBAAiB;IACnC,4BAA4B,EAAE,iBAAiB;IAC/C,6BAA6B,EAAE,iBAAiB;IAChD,6BAA6B,EAAE,iBAAiB;IAChD,8BAA8B,EAAE,iBAAiB;IACjD,UAAU,EAAE,6CAA6C;IACzD,YAAY,EAAE,YAAY,CAAC,QAAQ;IACnC,sBAAsB,EAAE,iBAAiB;IACzC,iCAAiC,EAAE,iBAAiB;IACpD,yBAAyB,EAAE,iBAAiB;IAC5C,wBAAwB,EAAE,iBAAiB;IAC3C,qBAAqB,EAAE,iBAAiB;IACxC,qBAAqB,EAAE,iBAAiB;IACxC,uBAAuB,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAClF,uBAAuB,EAAE,iBAAiB;IAC1C,6BAA6B,EAAE,iBAAiB;IAChD,0BAA0B,EAAE,iBAAiB;IAC7C,eAAe,EAAE,iBAAiB;IAClC,wBAAwB,EAAE,iBAAiB;IAC3C,wBAAwB,EAAE,iBAAiB;IAC3C,qBAAqB,EAAE,iBAAiB;IACxC,yBAAyB,EAAE,iBAAiB;IAC5C,gBAAgB,EAAE,iBAAiB;IACnC,gBAAgB,EAAE,iBAAiB;IACnC,aAAa,EAAE,iBAAiB;IAChC,uBAAuB,EAAE,iBAAiB;IAC1C,cAAc,EAAE,iBAAiB;IACjC,iBAAiB,EAAE,iBAAiB;IACpC,iBAAiB,EAAE,iBAAiB;CACvC,CAAC,CAAC;AACH,eAAe,UAAU,CAAC"}
|
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { mockFrameAnimation } from '../__mocks__/
|
|
10
|
+
import { mockFrameAnimation } from '../__mocks__/Animations';
|
|
11
11
|
import { AnimationController } from '../../controllers/AnimationController';
|
|
12
12
|
import { getEditorResponseData, castToEditorResponse } from '../../utils/EditorResponseData';
|
|
13
13
|
let mockedAnimation;
|