@chili-publish/studio-sdk 1.46.2 → 1.47.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 +2 -2
- package/_bundles/main.js.map +1 -1
- package/lib/src/controllers/ComponentGridController.cjs.js.map +1 -1
- package/lib/src/controllers/ComponentGridController.es.js.map +1 -1
- package/lib/src/controllers/FrameController.cjs.js +8 -0
- package/lib/src/controllers/FrameController.cjs.js.map +1 -1
- package/lib/src/controllers/FrameController.d.ts +14 -0
- package/lib/src/controllers/FrameController.es.js +8 -0
- package/lib/src/controllers/FrameController.es.js.map +1 -1
- package/lib/src/controllers/UtilsController.cjs.js +4 -1
- package/lib/src/controllers/UtilsController.cjs.js.map +1 -1
- package/lib/src/controllers/UtilsController.es.js +4 -1
- package/lib/src/controllers/UtilsController.es.js.map +1 -1
- package/lib/src/next/controllers/PageController.cjs.js +1 -0
- package/lib/src/next/controllers/PageController.cjs.js.map +1 -1
- package/lib/src/next/controllers/PageController.es.js +1 -0
- package/lib/src/next/controllers/PageController.es.js.map +1 -1
- package/lib/src/sdk/editor-engine.json.cjs.js +1 -1
- package/lib/src/sdk/editor-engine.json.es.js +1 -1
- package/lib/src/sdk/package.json.cjs.js +1 -1
- package/lib/src/sdk/package.json.es.js +1 -1
- package/lib/src/sdk.cjs.js +26 -13
- package/lib/src/sdk.cjs.js.map +1 -1
- package/lib/src/sdk.d.ts +14 -0
- package/lib/src/sdk.es.js +26 -13
- package/lib/src/sdk.es.js.map +1 -1
- package/lib/src/types/BarcodeTypes.cjs.js.map +1 -1
- package/lib/src/types/BarcodeTypes.d.ts +3 -1
- package/lib/src/types/BarcodeTypes.es.js.map +1 -1
- package/lib/src/types/BrandKitTypes.d.ts +4 -2
- package/lib/src/types/CharacterStyleTypes.d.ts +6 -2
- package/lib/src/types/ColorStyleTypes.cjs.js.map +1 -1
- package/lib/src/types/ColorStyleTypes.es.js.map +1 -1
- package/lib/src/types/ComponentGridTypes.cjs.js.map +1 -1
- package/lib/src/types/ComponentGridTypes.es.js.map +1 -1
- package/lib/src/types/ConnectorTypes.cjs.js.map +1 -1
- package/lib/src/types/ConnectorTypes.es.js.map +1 -1
- package/lib/src/types/FrameTypes.cjs.js.map +1 -1
- package/lib/src/types/FrameTypes.d.ts +5 -0
- package/lib/src/types/FrameTypes.es.js.map +1 -1
- package/lib/src/types/ParagraphStyleTypes.cjs.js.map +1 -1
- package/lib/src/types/ParagraphStyleTypes.d.ts +6 -2
- package/lib/src/types/ParagraphStyleTypes.es.js.map +1 -1
- package/lib/src/types/RichTextRuleTypes.cjs.js.map +1 -1
- package/lib/src/types/RichTextRuleTypes.es.js.map +1 -1
- package/lib/src/types/ShapeTypes.cjs.js.map +1 -1
- package/lib/src/types/ShapeTypes.d.ts +2 -0
- package/lib/src/types/ShapeTypes.es.js.map +1 -1
- package/lib/src/types/TextStyleTypes.cjs.js.map +1 -1
- package/lib/src/types/TextStyleTypes.d.ts +2 -1
- package/lib/src/types/TextStyleTypes.es.js.map +1 -1
- package/lib/src/types/VariableTypes.cjs.js.map +1 -1
- package/lib/src/types/VariableTypes.es.js.map +1 -1
- package/lib/src/utils/EngineCallbackHandler.cjs.js.map +1 -1
- package/lib/src/utils/EngineCallbackHandler.es.js.map +1 -1
- package/lib/src/utils/EngineEvent.cjs.js.map +1 -1
- package/lib/src/utils/EngineEvent.es.js.map +1 -1
- package/package.json +17 -20
|
@@ -14,7 +14,8 @@ export type CharacterStyle = {
|
|
|
14
14
|
textIndent?: string;
|
|
15
15
|
baselineShiftValue?: string;
|
|
16
16
|
lineHeight?: number;
|
|
17
|
-
|
|
17
|
+
fillOverprint?: boolean;
|
|
18
|
+
strokeOverprint?: boolean;
|
|
18
19
|
color: ColorUsage;
|
|
19
20
|
strokeColor: ColorUsage;
|
|
20
21
|
backgroundColor: ColorUsage;
|
|
@@ -56,7 +57,10 @@ export type CharacterStyleUpdate = {
|
|
|
56
57
|
lineHeight?: {
|
|
57
58
|
value: number;
|
|
58
59
|
};
|
|
59
|
-
|
|
60
|
+
fillOverprint?: {
|
|
61
|
+
value: boolean;
|
|
62
|
+
};
|
|
63
|
+
strokeOverprint?: {
|
|
60
64
|
value: boolean;
|
|
61
65
|
};
|
|
62
66
|
color?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorStyleTypes.cjs.js","sources":["../../../src/types/ColorStyleTypes.ts"],"sourcesContent":["import { Id } from './CommonTypes';\n\nexport enum APIColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n spotCmyk = 'spotCmyk',\n spotRgb = 'spotRgb',\n spotHex = 'spotHex',\n}\nexport enum ColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n gray = 'gray',\n hsl = 'hsl',\n /**\n * @deprecated Use spotCMYK or spotRGB instead\n */\n spot = 'spot',\n spotCMYK = 'spotCMYK',\n spotRGB = 'spotRGB',\n spotHEX = 'spotHEX',\n}\n\nexport type RGBColor = {\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type CMYKColor = {\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type HSLColor = {\n h: number;\n s: number;\n l: number;\n type: ColorType;\n};\n\nexport type GrayColor = {\n g: number;\n type: ColorType;\n};\n\n/**\n * @deprecated Use SpotColorCMYK or SpotColorRGB instead\n */\nexport type SpotColor = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorCMYK = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorRGB = {\n spotName: string;\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type SpotColorHEX = {\n spotName: string;\n value: string;\n type: ColorType;\n};\n\nexport type HexColor = {\n value: string;\n type: ColorType;\n};\n\nexport type Color =\n
|
|
1
|
+
{"version":3,"file":"ColorStyleTypes.cjs.js","sources":["../../../src/types/ColorStyleTypes.ts"],"sourcesContent":["import { Id } from './CommonTypes';\n\nexport enum APIColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n spotCmyk = 'spotCmyk',\n spotRgb = 'spotRgb',\n spotHex = 'spotHex',\n}\nexport enum ColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n gray = 'gray',\n hsl = 'hsl',\n /**\n * @deprecated Use spotCMYK or spotRGB instead\n */\n spot = 'spot',\n spotCMYK = 'spotCMYK',\n spotRGB = 'spotRGB',\n spotHEX = 'spotHEX',\n}\n\nexport type RGBColor = {\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type CMYKColor = {\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type HSLColor = {\n h: number;\n s: number;\n l: number;\n type: ColorType;\n};\n\nexport type GrayColor = {\n g: number;\n type: ColorType;\n};\n\n/**\n * @deprecated Use SpotColorCMYK or SpotColorRGB instead\n */\nexport type SpotColor = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorCMYK = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorRGB = {\n spotName: string;\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type SpotColorHEX = {\n spotName: string;\n value: string;\n type: ColorType;\n};\n\nexport type HexColor = {\n value: string;\n type: ColorType;\n};\n\nexport type Color =\n RGBColor | CMYKColor | HSLColor | GrayColor | SpotColor | HexColor | SpotColorCMYK | SpotColorRGB | SpotColorHEX;\n\nexport type ColorUpdate = Color;\n\nexport type DocumentColor = {\n id: string;\n name: string;\n color: Color;\n};\n\nexport type ColorUsageUpdate = {\n /**\n * Reference to the brand kit color, can only be used if it is a brand kit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: ColorUpdate;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n /**\n * Indicates if the color will be applied or not.\n */\n isApplied?: boolean;\n};\n\nexport type ColorUsage = {\n /**\n * Reference to the brand kit color, can only be used if it is a brand kit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: Color;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n};\n\nexport enum ColorUsageType {\n /**\n * The color is defined locally on the object\n */\n local = 'local',\n /**\n * The color is referencing a document color\n */\n brandKit = 'brandKit',\n /**\n * @deprecated use brandKit instead\n *\n * The color is referencing a brand kit color\n */\n // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values\n stylekit = 'brandKit',\n}\n"],"names":["APIColorType","ColorType","ColorUsageType"],"mappings":";;AAEO,IAAK,iCAAAA,kBAAL;AACHA,gBAAA,KAAA,IAAM;AACNA,gBAAA,KAAA,IAAM;AACNA,gBAAA,MAAA,IAAO;AACPA,gBAAA,UAAA,IAAW;AACXA,gBAAA,SAAA,IAAU;AACVA,gBAAA,SAAA,IAAU;AANF,SAAAA;AAAA,GAAA,gBAAA,CAAA,CAAA;AAQL,IAAK,8BAAAC,eAAL;AACHA,aAAA,KAAA,IAAM;AACNA,aAAA,KAAA,IAAM;AACNA,aAAA,MAAA,IAAO;AACPA,aAAA,MAAA,IAAO;AACPA,aAAA,KAAA,IAAM;AAINA,aAAA,MAAA,IAAO;AACPA,aAAA,UAAA,IAAW;AACXA,aAAA,SAAA,IAAU;AACVA,aAAA,SAAA,IAAU;AAZF,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAiIL,IAAK,mCAAAC,oBAAL;AAIHA,kBAAA,OAAA,IAAQ;AAIRA,kBAAA,UAAA,IAAW;AAOXA,kBAAA,UAAA,IAAW;AAfH,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorStyleTypes.es.js","sources":["../../../src/types/ColorStyleTypes.ts"],"sourcesContent":["import { Id } from './CommonTypes';\n\nexport enum APIColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n spotCmyk = 'spotCmyk',\n spotRgb = 'spotRgb',\n spotHex = 'spotHex',\n}\nexport enum ColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n gray = 'gray',\n hsl = 'hsl',\n /**\n * @deprecated Use spotCMYK or spotRGB instead\n */\n spot = 'spot',\n spotCMYK = 'spotCMYK',\n spotRGB = 'spotRGB',\n spotHEX = 'spotHEX',\n}\n\nexport type RGBColor = {\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type CMYKColor = {\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type HSLColor = {\n h: number;\n s: number;\n l: number;\n type: ColorType;\n};\n\nexport type GrayColor = {\n g: number;\n type: ColorType;\n};\n\n/**\n * @deprecated Use SpotColorCMYK or SpotColorRGB instead\n */\nexport type SpotColor = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorCMYK = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorRGB = {\n spotName: string;\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type SpotColorHEX = {\n spotName: string;\n value: string;\n type: ColorType;\n};\n\nexport type HexColor = {\n value: string;\n type: ColorType;\n};\n\nexport type Color =\n
|
|
1
|
+
{"version":3,"file":"ColorStyleTypes.es.js","sources":["../../../src/types/ColorStyleTypes.ts"],"sourcesContent":["import { Id } from './CommonTypes';\n\nexport enum APIColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n spotCmyk = 'spotCmyk',\n spotRgb = 'spotRgb',\n spotHex = 'spotHex',\n}\nexport enum ColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n gray = 'gray',\n hsl = 'hsl',\n /**\n * @deprecated Use spotCMYK or spotRGB instead\n */\n spot = 'spot',\n spotCMYK = 'spotCMYK',\n spotRGB = 'spotRGB',\n spotHEX = 'spotHEX',\n}\n\nexport type RGBColor = {\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type CMYKColor = {\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type HSLColor = {\n h: number;\n s: number;\n l: number;\n type: ColorType;\n};\n\nexport type GrayColor = {\n g: number;\n type: ColorType;\n};\n\n/**\n * @deprecated Use SpotColorCMYK or SpotColorRGB instead\n */\nexport type SpotColor = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorCMYK = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorRGB = {\n spotName: string;\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type SpotColorHEX = {\n spotName: string;\n value: string;\n type: ColorType;\n};\n\nexport type HexColor = {\n value: string;\n type: ColorType;\n};\n\nexport type Color =\n RGBColor | CMYKColor | HSLColor | GrayColor | SpotColor | HexColor | SpotColorCMYK | SpotColorRGB | SpotColorHEX;\n\nexport type ColorUpdate = Color;\n\nexport type DocumentColor = {\n id: string;\n name: string;\n color: Color;\n};\n\nexport type ColorUsageUpdate = {\n /**\n * Reference to the brand kit color, can only be used if it is a brand kit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: ColorUpdate;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n /**\n * Indicates if the color will be applied or not.\n */\n isApplied?: boolean;\n};\n\nexport type ColorUsage = {\n /**\n * Reference to the brand kit color, can only be used if it is a brand kit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: Color;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n};\n\nexport enum ColorUsageType {\n /**\n * The color is defined locally on the object\n */\n local = 'local',\n /**\n * The color is referencing a document color\n */\n brandKit = 'brandKit',\n /**\n * @deprecated use brandKit instead\n *\n * The color is referencing a brand kit color\n */\n // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values\n stylekit = 'brandKit',\n}\n"],"names":["APIColorType","ColorType","ColorUsageType"],"mappings":"AAEO,IAAK,iCAAAA,kBAAL;AACHA,gBAAA,KAAA,IAAM;AACNA,gBAAA,KAAA,IAAM;AACNA,gBAAA,MAAA,IAAO;AACPA,gBAAA,UAAA,IAAW;AACXA,gBAAA,SAAA,IAAU;AACVA,gBAAA,SAAA,IAAU;AANF,SAAAA;AAAA,GAAA,gBAAA,CAAA,CAAA;AAQL,IAAK,8BAAAC,eAAL;AACHA,aAAA,KAAA,IAAM;AACNA,aAAA,KAAA,IAAM;AACNA,aAAA,MAAA,IAAO;AACPA,aAAA,MAAA,IAAO;AACPA,aAAA,KAAA,IAAM;AAINA,aAAA,MAAA,IAAO;AACPA,aAAA,UAAA,IAAW;AACXA,aAAA,SAAA,IAAU;AACVA,aAAA,SAAA,IAAU;AAZF,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAiIL,IAAK,mCAAAC,oBAAL;AAIHA,kBAAA,OAAA,IAAQ;AAIRA,kBAAA,UAAA,IAAW;AAOXA,kBAAA,UAAA,IAAW;AAfH,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentGridTypes.cjs.js","sources":["../../../src/types/ComponentGridTypes.ts"],"sourcesContent":["export type ComponentGridSettingsDeltaUpdate = {\n numberOfColumns?: {\n value: number;\n };\n numberOfRows?: {\n value: number;\n };\n columnGap?: {\n value: string;\n };\n rowGap?: {\n value: string;\n };\n};\n\nexport enum ComponentGridLayoutAlgorithm {\n fixed = 'fixed',\n}\n\nexport type FixedComponentGridSettings = {\n type: ComponentGridLayoutAlgorithm.fixed;\n numberOfColumns: number;\n numberOfRows: number;\n columnGap: number;\n rowGap: number;\n};\n\nexport type ComponentGridSettings = FixedComponentGridSettings /* | More will be added later
|
|
1
|
+
{"version":3,"file":"ComponentGridTypes.cjs.js","sources":["../../../src/types/ComponentGridTypes.ts"],"sourcesContent":["export type ComponentGridSettingsDeltaUpdate = {\n numberOfColumns?: {\n value: number;\n };\n numberOfRows?: {\n value: number;\n };\n columnGap?: {\n value: string;\n };\n rowGap?: {\n value: string;\n };\n};\n\nexport enum ComponentGridLayoutAlgorithm {\n fixed = 'fixed',\n}\n\nexport type FixedComponentGridSettings = {\n type: ComponentGridLayoutAlgorithm.fixed;\n numberOfColumns: number;\n numberOfRows: number;\n columnGap: number;\n rowGap: number;\n};\n\nexport type ComponentGridSettings = FixedComponentGridSettings; /* | More will be added later */\n"],"names":["ComponentGridLayoutAlgorithm"],"mappings":";;AAeO,IAAK,iDAAAA,kCAAL;AACHA,gCAAA,OAAA,IAAQ;AADA,SAAAA;AAAA,GAAA,gCAAA,CAAA,CAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentGridTypes.es.js","sources":["../../../src/types/ComponentGridTypes.ts"],"sourcesContent":["export type ComponentGridSettingsDeltaUpdate = {\n numberOfColumns?: {\n value: number;\n };\n numberOfRows?: {\n value: number;\n };\n columnGap?: {\n value: string;\n };\n rowGap?: {\n value: string;\n };\n};\n\nexport enum ComponentGridLayoutAlgorithm {\n fixed = 'fixed',\n}\n\nexport type FixedComponentGridSettings = {\n type: ComponentGridLayoutAlgorithm.fixed;\n numberOfColumns: number;\n numberOfRows: number;\n columnGap: number;\n rowGap: number;\n};\n\nexport type ComponentGridSettings = FixedComponentGridSettings /* | More will be added later
|
|
1
|
+
{"version":3,"file":"ComponentGridTypes.es.js","sources":["../../../src/types/ComponentGridTypes.ts"],"sourcesContent":["export type ComponentGridSettingsDeltaUpdate = {\n numberOfColumns?: {\n value: number;\n };\n numberOfRows?: {\n value: number;\n };\n columnGap?: {\n value: string;\n };\n rowGap?: {\n value: string;\n };\n};\n\nexport enum ComponentGridLayoutAlgorithm {\n fixed = 'fixed',\n}\n\nexport type FixedComponentGridSettings = {\n type: ComponentGridLayoutAlgorithm.fixed;\n numberOfColumns: number;\n numberOfRows: number;\n columnGap: number;\n rowGap: number;\n};\n\nexport type ComponentGridSettings = FixedComponentGridSettings; /* | More will be added later */\n"],"names":["ComponentGridLayoutAlgorithm"],"mappings":"AAeO,IAAK,iDAAAA,kCAAL;AACHA,gCAAA,OAAA,IAAQ;AADA,SAAAA;AAAA,GAAA,gCAAA,CAAA,CAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectorTypes.cjs.js","sources":["../../../src/types/ConnectorTypes.ts"],"sourcesContent":["import type {\n Dictionary as ContextDictionary,\n ConnectorConfigOptions as GenericConnectorConfigOptions,\n ConnectorConfigValue as GenericConnectorConfigValue,\n QueryPage as QueryResult,\n} from '@chili-studio/connector-types';\nimport { Id } from './CommonTypes';\n\nexport type { FilePointer, QueryOptions } from '@chili-studio/connector-types';\n\nexport enum DeprecatedMediaType {\n file = 0,\n collection = 1,\n}\n\nexport enum DeprecatedMediaConnectorDownloadType {\n LowResolutionWeb = 'lowresWeb',\n HighResolutionWeb = 'highresWeb',\n}\n\nexport enum MediaType {\n file = 'file',\n collection = 'collection',\n}\n\nexport enum ConnectorType {\n media = 'media',\n fonts = 'fonts',\n data = 'data',\n /**\n * @experimental This is still experimental and might change in future releases.\n */\n components = 'components',\n}\n\nexport enum SortBy {\n name = 'name',\n path = 'relativePath',\n id = 'id',\n}\n\nexport enum SortOrder {\n ascending = 'asc',\n descending = 'desc',\n}\n\nexport enum ConnectorConfigValueType {\n text = 'text',\n boolean = 'boolean',\n number = 'number',\n}\n\nexport enum ConnectorConfigContextType {\n query = 'query',\n upload = 'upload',\n}\n\nexport type ConnectorConfigValue = GenericConnectorConfigValue<ConnectorConfigValueType, ConnectorConfigContextType>;\nexport type ConnectorConfigOptions = GenericConnectorConfigOptions<\n ConnectorConfigValueType,\n ConnectorConfigContextType\n>;\n\ninterface ConnectorRegistrationBase {\n /**\n * Url to the connector.\n *\n * - If source is `url`, this must be a publicly accessible url.\n *\n * - If source is `grafx`, this must be the full url to the connector GET endpoint on GraFx Environment API.\n */\n url: string;\n\n /**\n * Connector source type.\n */\n source: ConnectorRegistrationSource;\n}\n\nexport interface ConnectorUrlRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.url;\n}\n\nexport interface ConnectorGrafxRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.grafx;\n}\n\nexport interface ConnectorLocalRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.local;\n}\n\nexport type ConnectorRegistration = ConnectorUrlRegistration | ConnectorGrafxRegistration | ConnectorLocalRegistration;\n\nexport type ConnectorInstance = {\n id: Id;\n name: string;\n iconUrl: string;\n source: ConnectorRegistration;\n};\n\nexport enum ConnectorRegistrationSource {\n /**\n * Connector is hosted on a publicly accessible link.\n */\n url = 'url',\n\n /**\n * Connector is hosted on GraFx Environment API.\n */\n grafx = 'grafx',\n\n /**\n * Connector is embedded in the document.\n * Note: This is a temporary type; only to be used internally.\n */\n local = 'local',\n}\n\nexport interface EngineToConnectorMapping {\n name: string;\n value: ContextDictionary[keyof ContextDictionary];\n id?: Id;\n sourceField?: string; // for data source variables\n type: ConnectorMappingSource;\n direction: ConnectorMappingDirection.engineToConnector;\n}\n\nexport interface ConnectorToEngineMapping {\n name: string;\n /** @deprecated Use id instead. This property holds a string representation of the id in the form: var.<id> */\n value: string;\n id?: Id;\n type: ConnectorMappingSource.variable;\n direction: ConnectorMappingDirection.connectorToEngine;\n}\n\nexport type ConnectorMappingType = EngineToConnectorMapping | ConnectorToEngineMapping;\n\nexport class ConnectorMapping implements EngineToConnectorMapping, ConnectorToEngineMapping {\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any;\n sourceField?: string; // for data source variables\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n direction: any = ConnectorMappingDirection.engineToConnector;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n id?: Id;\n\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource.variable,\n sourceValue: string,\n direction: ConnectorMappingDirection.connectorToEngine,\n );\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction?: ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n );\n constructor(contextProperty: string, mapFrom: ConnectorMappingSource, sourceValue: string | boolean | number);\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction = ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n ) {\n this.name = contextProperty;\n this.direction = direction;\n\n if (mapFrom === ConnectorMappingSource.variable) {\n this.value = `var.${sourceValue}`;\n this.id = sourceValue as Id;\n this.type = ConnectorMappingSource.variable;\n this.sourceField = sourceField;\n } else {\n this.value = sourceValue;\n this.type = ConnectorMappingSource.value;\n }\n }\n}\n\nexport type ConnectorState = {\n id: Id;\n type: ConnectorStateType;\n};\n\nexport type ConnectorEvent = {\n id: Id;\n type: ConnectorEventType;\n};\n\nexport type QueryPage<T> = Omit<QueryResult<T>, 'links'> & {\n nextPageToken?: string;\n};\n\nexport enum ConnectorMappingSource {\n variable = 'var',\n value = 'value',\n}\n\n/**\n * Direction of the Connector Mapping.\n */\nexport enum ConnectorMappingDirection {\n /**\n * Indicates the mapping will propagate a value to the connector. This\n * mapping might cause the linked connector to refresh.\n */\n engineToConnector = 'engineToConnector',\n\n /**\n * Indicates the mapping will propagate a value from inside the connector\n * to the engine. AKA \"reverse mapping\".\n */\n connectorToEngine = 'connectorToEngine',\n}\n\nexport enum ConnectorStateType {\n /**\n * Connector loading process has started.\n * Any SDK methods that required the connector id, will start working now.\n */\n loading = 'loading',\n\n /**\n * Connector loading completed.\n */\n loaded = 'loaded',\n\n /**\n * Connector is running in QuickJS.\n */\n\n running = 'running',\n\n /**\n * Connector is fully configured and has the correct authentication information.\n * At this point the connector is ready to make requests.\n */\n ready = 'ready',\n\n /**\n * Something went wrong, the connector is in error state.\n * Check the error message for more information.\n */\n error = 'error',\n}\n\nexport enum ConnectorEventType {\n /**\n * This event will be triggered by the following state changes of the connector\n * - loading\n * - loaded\n * - running\n * - ready\n * - error\n */\n stateChanged = 'stateChanged',\n\n /**\n * Authentication information is changed\n */\n authChanged = 'authChanged',\n\n /**\n * Connector configuration changed that requires the connector to be reloaded in QuickJS.\n * This will trigger multiple 'stateChanged' events while it is reloading.\n * Wait until 'ready'-stateChanged event is received to start using the connector again.\n */\n reloadRequired = 'reloadRequired',\n\n /**\n * Connector is unregistered and no longer exists inside the editor engine.\n * Don't use the 'connectorId' after receiving this event.\n */\n unloaded = 'unloaded',\n}\n\n/**\n * Hardcoded grafx media connector until we get it from the environment.\n */\nexport const grafxMediaConnectorRegistration: ConnectorLocalRegistration = {\n url: 'grafx-media.json',\n source: ConnectorRegistrationSource.local,\n};\n\n/**\n * Grafx token to return to the engine when it expires.\n */\nexport class GrafxTokenAuthCredentials {\n token: string;\n type = AuthCredentialsTypeEnum.grafxToken;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(token: string, headers?: Record<string, string>) {\n this.token = token;\n this.headers = headers;\n }\n}\n\n/**\n * Notification to return to the engine whenever a 3rd party auth (user impersonation)\n * has been renewed by the integration.\n */\nexport class RefreshedAuthCredendentials {\n type = AuthCredentialsTypeEnum.refreshed;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(headers?: Record<string, string>) {\n this.headers = headers;\n }\n}\n\nexport enum AuthCredentialsTypeEnum {\n grafxToken = 'grafxToken',\n refreshed = 'refreshed',\n}\n\nexport type AuthCredentials = GrafxTokenAuthCredentials | RefreshedAuthCredendentials;\n\nexport enum AuthRefreshTypeEnum {\n grafxToken = 'grafxToken',\n any = 'any',\n}\n\nexport type GrafxAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.grafxToken;\n};\n\n/**\n * @param connectorId connector id\n * @param remoteConnectorId remote connector id\n * @param headerValue the value of the X-GRAFX-UNAUTHORIZED header. This\n * will notify that the dam authentication expired if it went through the\n * proxy.\n * Example: \"Static, 1234\", \"OAuthClientCredentials, 5678\"\n * If the http request did not go through the proxy, headerValue is null.\n */\nexport type AnyAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.any;\n connectorId: Id;\n remoteConnectorId: Id;\n headerValue: string | null;\n connectorDefinition: ConnectorDefinition;\n};\n\nexport type AuthRefreshRequest = GrafxAuthRefreshRequest | AnyAuthRefreshRequest;\n\nexport type ConnectorOptions = ContextDictionary;\nexport type MetaData = ContextDictionary;\n\nexport type UploadValidationConfiguration = {\n minWidthPixels?: number | null;\n maxWidthPixels?: number | null;\n minHeightPixels?: number | null;\n maxHeightPixels?: number | null;\n mimeTypes?: string[];\n};\n\nexport enum UploadAssetValidationErrorType {\n minDimension = 'minDimension',\n}\n\nexport class UploadAssetValidationError extends Error {\n constructor(message: string, public type: UploadAssetValidationErrorType) {\n super(message);\n }\n}\n\nexport enum ConnectorSupportedAuth {\n StaticKey = 'staticKey',\n OAuth2ClientCredentials = 'oAuth2ClientCredentials',\n OAuth2AuthorizationCode = 'oAuth2AuthorizationCode',\n OAuth2ResourceOwnerPassword = 'oAuth2ResourceOwnerPassword',\n OAuth2JwtBearer = 'oAuth2JwtBearer',\n None = 'none',\n}\n\ninterface ConnectorDefinition {\n id: Id;\n name: string;\n type: ConnectorType;\n supportedAuthentication: { browser: ConnectorSupportedAuth[]; server: ConnectorSupportedAuth[] };\n externalSourceId?: string | null;\n}\n"],"names":["DeprecatedMediaType","DeprecatedMediaConnectorDownloadType","MediaType","ConnectorType","SortBy","SortOrder","ConnectorConfigValueType","ConnectorConfigContextType","ConnectorRegistrationSource","ConnectorMappingSource","ConnectorMappingDirection","ConnectorStateType","ConnectorEventType","AuthCredentialsTypeEnum","AuthRefreshTypeEnum","UploadAssetValidationErrorType","ConnectorSupportedAuth"],"mappings":";;AAUO,IAAK,wCAAAA,yBAAL;AACHA,uBAAAA,qBAAA,UAAO,CAAA,IAAP;AACAA,uBAAAA,qBAAA,gBAAa,CAAA,IAAb;AAFQ,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAKL,IAAK,yDAAAC,0CAAL;AACHA,wCAAA,kBAAA,IAAmB;AACnBA,wCAAA,mBAAA,IAAoB;AAFZ,SAAAA;AAAA,GAAA,wCAAA,CAAA,CAAA;AAKL,IAAK,8BAAAC,eAAL;AACHA,aAAA,MAAA,IAAO;AACPA,aAAA,YAAA,IAAa;AAFL,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAKL,IAAK,kCAAAC,mBAAL;AACHA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,MAAA,IAAO;AAIPA,iBAAA,YAAA,IAAa;AAPL,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AAUL,IAAK,2BAAAC,YAAL;AACHA,UAAA,MAAA,IAAO;AACPA,UAAA,MAAA,IAAO;AACPA,UAAA,IAAA,IAAK;AAHG,SAAAA;AAAA,GAAA,UAAA,CAAA,CAAA;AAML,IAAK,8BAAAC,eAAL;AACHA,aAAA,WAAA,IAAY;AACZA,aAAA,YAAA,IAAa;AAFL,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAKL,IAAK,6CAAAC,8BAAL;AACHA,4BAAA,MAAA,IAAO;AACPA,4BAAA,SAAA,IAAU;AACVA,4BAAA,QAAA,IAAS;AAHD,SAAAA;AAAA,GAAA,4BAAA,CAAA,CAAA;AAML,IAAK,+CAAAC,gCAAL;AACHA,8BAAA,OAAA,IAAQ;AACRA,8BAAA,QAAA,IAAS;AAFD,SAAAA;AAAA,GAAA,8BAAA,CAAA,CAAA;AAgDL,IAAK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AAe,SAAkC;AAN7D,SAAA,OAAO;AAOH,SAAK,QAAQ;AACb,SAAK,UAAU;AAAA,EACnB;AACJ;AAMO,MAAM,4BAA4B;AAAA,EAOrC,YAAY,SAAkC;AAN9C,SAAA,OAAO;AAOH,SAAK,UAAU;AAAA,EACnB;AACJ;AAEO,IAAK,4CAAAC,6BAAL;AACHA,2BAAA,YAAA,IAAa;AACbA,2BAAA,WAAA,IAAY;AAFJ,SAAAA;AAAA,GAAA,2BAAA,CAAA,CAAA;AAOL,IAAK,wCAAAC,yBAAL;AACHA,uBAAA,YAAA,IAAa;AACbA,uBAAA,KAAA,IAAM;AAFE,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAuCL,IAAK,mDAAAC,oCAAL;AACHA,kCAAA,cAAA,IAAe;AADP,SAAAA;AAAA,GAAA,kCAAA,CAAA,CAAA;AAIL,MAAM,mCAAmC,MAAM;AAAA,EAClD,YAAY,SAAwB,MAAsC;AACtE,UAAM,OAAO;AADmB,SAAA,OAAA;AAAA,EAEpC;AACJ;AAEO,IAAK,2CAAAC,4BAAL;AACHA,0BAAA,WAAA,IAAY;AACZA,0BAAA,yBAAA,IAA0B;AAC1BA,0BAAA,yBAAA,IAA0B;AAC1BA,0BAAA,6BAAA,IAA8B;AAC9BA,0BAAA,iBAAA,IAAkB;AAClBA,0BAAA,MAAA,IAAO;AANC,SAAAA;AAAA,GAAA,0BAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ConnectorTypes.cjs.js","sources":["../../../src/types/ConnectorTypes.ts"],"sourcesContent":["import type {\n Dictionary as ContextDictionary,\n ConnectorConfigOptions as GenericConnectorConfigOptions,\n ConnectorConfigValue as GenericConnectorConfigValue,\n QueryPage as QueryResult,\n} from '@chili-studio/connector-types';\nimport { Id } from './CommonTypes';\n\nexport type { FilePointer, QueryOptions } from '@chili-studio/connector-types';\n\nexport enum DeprecatedMediaType {\n file = 0,\n collection = 1,\n}\n\nexport enum DeprecatedMediaConnectorDownloadType {\n LowResolutionWeb = 'lowresWeb',\n HighResolutionWeb = 'highresWeb',\n}\n\nexport enum MediaType {\n file = 'file',\n collection = 'collection',\n}\n\nexport enum ConnectorType {\n media = 'media',\n fonts = 'fonts',\n data = 'data',\n /**\n * @experimental This is still experimental and might change in future releases.\n */\n components = 'components',\n}\n\nexport enum SortBy {\n name = 'name',\n path = 'relativePath',\n id = 'id',\n}\n\nexport enum SortOrder {\n ascending = 'asc',\n descending = 'desc',\n}\n\nexport enum ConnectorConfigValueType {\n text = 'text',\n boolean = 'boolean',\n number = 'number',\n}\n\nexport enum ConnectorConfigContextType {\n query = 'query',\n upload = 'upload',\n}\n\nexport type ConnectorConfigValue = GenericConnectorConfigValue<ConnectorConfigValueType, ConnectorConfigContextType>;\nexport type ConnectorConfigOptions = GenericConnectorConfigOptions<\n ConnectorConfigValueType,\n ConnectorConfigContextType\n>;\n\ninterface ConnectorRegistrationBase {\n /**\n * Url to the connector.\n *\n * - If source is `url`, this must be a publicly accessible url.\n *\n * - If source is `grafx`, this must be the full url to the connector GET endpoint on GraFx Environment API.\n */\n url: string;\n\n /**\n * Connector source type.\n */\n source: ConnectorRegistrationSource;\n}\n\nexport interface ConnectorUrlRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.url;\n}\n\nexport interface ConnectorGrafxRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.grafx;\n}\n\nexport interface ConnectorLocalRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.local;\n}\n\nexport type ConnectorRegistration = ConnectorUrlRegistration | ConnectorGrafxRegistration | ConnectorLocalRegistration;\n\nexport type ConnectorInstance = {\n id: Id;\n name: string;\n iconUrl: string;\n source: ConnectorRegistration;\n};\n\nexport enum ConnectorRegistrationSource {\n /**\n * Connector is hosted on a publicly accessible link.\n */\n url = 'url',\n\n /**\n * Connector is hosted on GraFx Environment API.\n */\n grafx = 'grafx',\n\n /**\n * Connector is embedded in the document.\n * Note: This is a temporary type; only to be used internally.\n */\n local = 'local',\n}\n\nexport interface EngineToConnectorMapping {\n name: string;\n value: ContextDictionary[keyof ContextDictionary];\n id?: Id;\n sourceField?: string; // for data source variables\n type: ConnectorMappingSource;\n direction: ConnectorMappingDirection.engineToConnector;\n}\n\nexport interface ConnectorToEngineMapping {\n name: string;\n /** @deprecated Use id instead. This property holds a string representation of the id in the form: var.<id> */\n value: string;\n id?: Id;\n type: ConnectorMappingSource.variable;\n direction: ConnectorMappingDirection.connectorToEngine;\n}\n\nexport type ConnectorMappingType = EngineToConnectorMapping | ConnectorToEngineMapping;\n\nexport class ConnectorMapping implements EngineToConnectorMapping, ConnectorToEngineMapping {\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any;\n sourceField?: string; // for data source variables\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n direction: any = ConnectorMappingDirection.engineToConnector;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n id?: Id;\n\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource.variable,\n sourceValue: string,\n direction: ConnectorMappingDirection.connectorToEngine,\n );\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction?: ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n );\n constructor(contextProperty: string, mapFrom: ConnectorMappingSource, sourceValue: string | boolean | number);\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction = ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n ) {\n this.name = contextProperty;\n this.direction = direction;\n\n if (mapFrom === ConnectorMappingSource.variable) {\n this.value = `var.${sourceValue}`;\n this.id = sourceValue as Id;\n this.type = ConnectorMappingSource.variable;\n this.sourceField = sourceField;\n } else {\n this.value = sourceValue;\n this.type = ConnectorMappingSource.value;\n }\n }\n}\n\nexport type ConnectorState = {\n id: Id;\n type: ConnectorStateType;\n};\n\nexport type ConnectorEvent = {\n id: Id;\n type: ConnectorEventType;\n};\n\nexport type QueryPage<T> = Omit<QueryResult<T>, 'links'> & {\n nextPageToken?: string;\n};\n\nexport enum ConnectorMappingSource {\n variable = 'var',\n value = 'value',\n}\n\n/**\n * Direction of the Connector Mapping.\n */\nexport enum ConnectorMappingDirection {\n /**\n * Indicates the mapping will propagate a value to the connector. This\n * mapping might cause the linked connector to refresh.\n */\n engineToConnector = 'engineToConnector',\n\n /**\n * Indicates the mapping will propagate a value from inside the connector\n * to the engine. AKA \"reverse mapping\".\n */\n connectorToEngine = 'connectorToEngine',\n}\n\nexport enum ConnectorStateType {\n /**\n * Connector loading process has started.\n * Any SDK methods that required the connector id, will start working now.\n */\n loading = 'loading',\n\n /**\n * Connector loading completed.\n */\n loaded = 'loaded',\n\n /**\n * Connector is running in QuickJS.\n */\n\n running = 'running',\n\n /**\n * Connector is fully configured and has the correct authentication information.\n * At this point the connector is ready to make requests.\n */\n ready = 'ready',\n\n /**\n * Something went wrong, the connector is in error state.\n * Check the error message for more information.\n */\n error = 'error',\n}\n\nexport enum ConnectorEventType {\n /**\n * This event will be triggered by the following state changes of the connector\n * - loading\n * - loaded\n * - running\n * - ready\n * - error\n */\n stateChanged = 'stateChanged',\n\n /**\n * Authentication information is changed\n */\n authChanged = 'authChanged',\n\n /**\n * Connector configuration changed that requires the connector to be reloaded in QuickJS.\n * This will trigger multiple 'stateChanged' events while it is reloading.\n * Wait until 'ready'-stateChanged event is received to start using the connector again.\n */\n reloadRequired = 'reloadRequired',\n\n /**\n * Connector is unregistered and no longer exists inside the editor engine.\n * Don't use the 'connectorId' after receiving this event.\n */\n unloaded = 'unloaded',\n}\n\n/**\n * Hardcoded grafx media connector until we get it from the environment.\n */\nexport const grafxMediaConnectorRegistration: ConnectorLocalRegistration = {\n url: 'grafx-media.json',\n source: ConnectorRegistrationSource.local,\n};\n\n/**\n * Grafx token to return to the engine when it expires.\n */\nexport class GrafxTokenAuthCredentials {\n token: string;\n type = AuthCredentialsTypeEnum.grafxToken;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(token: string, headers?: Record<string, string>) {\n this.token = token;\n this.headers = headers;\n }\n}\n\n/**\n * Notification to return to the engine whenever a 3rd party auth (user impersonation)\n * has been renewed by the integration.\n */\nexport class RefreshedAuthCredendentials {\n type = AuthCredentialsTypeEnum.refreshed;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(headers?: Record<string, string>) {\n this.headers = headers;\n }\n}\n\nexport enum AuthCredentialsTypeEnum {\n grafxToken = 'grafxToken',\n refreshed = 'refreshed',\n}\n\nexport type AuthCredentials = GrafxTokenAuthCredentials | RefreshedAuthCredendentials;\n\nexport enum AuthRefreshTypeEnum {\n grafxToken = 'grafxToken',\n any = 'any',\n}\n\nexport type GrafxAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.grafxToken;\n};\n\n/**\n * @param connectorId connector id\n * @param remoteConnectorId remote connector id\n * @param headerValue the value of the X-GRAFX-UNAUTHORIZED header. This\n * will notify that the dam authentication expired if it went through the\n * proxy.\n * Example: \"Static, 1234\", \"OAuthClientCredentials, 5678\"\n * If the http request did not go through the proxy, headerValue is null.\n */\nexport type AnyAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.any;\n connectorId: Id;\n remoteConnectorId: Id;\n headerValue: string | null;\n connectorDefinition: ConnectorDefinition;\n};\n\nexport type AuthRefreshRequest = GrafxAuthRefreshRequest | AnyAuthRefreshRequest;\n\nexport type ConnectorOptions = ContextDictionary;\nexport type MetaData = ContextDictionary;\n\nexport type UploadValidationConfiguration = {\n minWidthPixels?: number | null;\n maxWidthPixels?: number | null;\n minHeightPixels?: number | null;\n maxHeightPixels?: number | null;\n mimeTypes?: string[];\n};\n\nexport enum UploadAssetValidationErrorType {\n minDimension = 'minDimension',\n}\n\nexport class UploadAssetValidationError extends Error {\n constructor(\n message: string,\n public type: UploadAssetValidationErrorType,\n ) {\n super(message);\n }\n}\n\nexport enum ConnectorSupportedAuth {\n StaticKey = 'staticKey',\n OAuth2ClientCredentials = 'oAuth2ClientCredentials',\n OAuth2AuthorizationCode = 'oAuth2AuthorizationCode',\n OAuth2ResourceOwnerPassword = 'oAuth2ResourceOwnerPassword',\n OAuth2JwtBearer = 'oAuth2JwtBearer',\n None = 'none',\n}\n\ninterface ConnectorDefinition {\n id: Id;\n name: string;\n type: ConnectorType;\n supportedAuthentication: { browser: ConnectorSupportedAuth[]; server: ConnectorSupportedAuth[] };\n externalSourceId?: string | null;\n}\n"],"names":["DeprecatedMediaType","DeprecatedMediaConnectorDownloadType","MediaType","ConnectorType","SortBy","SortOrder","ConnectorConfigValueType","ConnectorConfigContextType","ConnectorRegistrationSource","ConnectorMappingSource","ConnectorMappingDirection","ConnectorStateType","ConnectorEventType","AuthCredentialsTypeEnum","AuthRefreshTypeEnum","UploadAssetValidationErrorType","ConnectorSupportedAuth"],"mappings":";;AAUO,IAAK,wCAAAA,yBAAL;AACHA,uBAAAA,qBAAA,UAAO,CAAA,IAAP;AACAA,uBAAAA,qBAAA,gBAAa,CAAA,IAAb;AAFQ,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAKL,IAAK,yDAAAC,0CAAL;AACHA,wCAAA,kBAAA,IAAmB;AACnBA,wCAAA,mBAAA,IAAoB;AAFZ,SAAAA;AAAA,GAAA,wCAAA,CAAA,CAAA;AAKL,IAAK,8BAAAC,eAAL;AACHA,aAAA,MAAA,IAAO;AACPA,aAAA,YAAA,IAAa;AAFL,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAKL,IAAK,kCAAAC,mBAAL;AACHA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,MAAA,IAAO;AAIPA,iBAAA,YAAA,IAAa;AAPL,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AAUL,IAAK,2BAAAC,YAAL;AACHA,UAAA,M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AA,yBAAA,IAA0B;AAC1BA,0BAAA,6BAAA,IAA8B;AAC9BA,0BAAA,iBAAA,IAAkB;AAClBA,0BAAA,MAAA,IAAO;AANC,SAAAA;AAAA,GAAA,0BAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectorTypes.es.js","sources":["../../../src/types/ConnectorTypes.ts"],"sourcesContent":["import type {\n Dictionary as ContextDictionary,\n ConnectorConfigOptions as GenericConnectorConfigOptions,\n ConnectorConfigValue as GenericConnectorConfigValue,\n QueryPage as QueryResult,\n} from '@chili-studio/connector-types';\nimport { Id } from './CommonTypes';\n\nexport type { FilePointer, QueryOptions } from '@chili-studio/connector-types';\n\nexport enum DeprecatedMediaType {\n file = 0,\n collection = 1,\n}\n\nexport enum DeprecatedMediaConnectorDownloadType {\n LowResolutionWeb = 'lowresWeb',\n HighResolutionWeb = 'highresWeb',\n}\n\nexport enum MediaType {\n file = 'file',\n collection = 'collection',\n}\n\nexport enum ConnectorType {\n media = 'media',\n fonts = 'fonts',\n data = 'data',\n /**\n * @experimental This is still experimental and might change in future releases.\n */\n components = 'components',\n}\n\nexport enum SortBy {\n name = 'name',\n path = 'relativePath',\n id = 'id',\n}\n\nexport enum SortOrder {\n ascending = 'asc',\n descending = 'desc',\n}\n\nexport enum ConnectorConfigValueType {\n text = 'text',\n boolean = 'boolean',\n number = 'number',\n}\n\nexport enum ConnectorConfigContextType {\n query = 'query',\n upload = 'upload',\n}\n\nexport type ConnectorConfigValue = GenericConnectorConfigValue<ConnectorConfigValueType, ConnectorConfigContextType>;\nexport type ConnectorConfigOptions = GenericConnectorConfigOptions<\n ConnectorConfigValueType,\n ConnectorConfigContextType\n>;\n\ninterface ConnectorRegistrationBase {\n /**\n * Url to the connector.\n *\n * - If source is `url`, this must be a publicly accessible url.\n *\n * - If source is `grafx`, this must be the full url to the connector GET endpoint on GraFx Environment API.\n */\n url: string;\n\n /**\n * Connector source type.\n */\n source: ConnectorRegistrationSource;\n}\n\nexport interface ConnectorUrlRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.url;\n}\n\nexport interface ConnectorGrafxRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.grafx;\n}\n\nexport interface ConnectorLocalRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.local;\n}\n\nexport type ConnectorRegistration = ConnectorUrlRegistration | ConnectorGrafxRegistration | ConnectorLocalRegistration;\n\nexport type ConnectorInstance = {\n id: Id;\n name: string;\n iconUrl: string;\n source: ConnectorRegistration;\n};\n\nexport enum ConnectorRegistrationSource {\n /**\n * Connector is hosted on a publicly accessible link.\n */\n url = 'url',\n\n /**\n * Connector is hosted on GraFx Environment API.\n */\n grafx = 'grafx',\n\n /**\n * Connector is embedded in the document.\n * Note: This is a temporary type; only to be used internally.\n */\n local = 'local',\n}\n\nexport interface EngineToConnectorMapping {\n name: string;\n value: ContextDictionary[keyof ContextDictionary];\n id?: Id;\n sourceField?: string; // for data source variables\n type: ConnectorMappingSource;\n direction: ConnectorMappingDirection.engineToConnector;\n}\n\nexport interface ConnectorToEngineMapping {\n name: string;\n /** @deprecated Use id instead. This property holds a string representation of the id in the form: var.<id> */\n value: string;\n id?: Id;\n type: ConnectorMappingSource.variable;\n direction: ConnectorMappingDirection.connectorToEngine;\n}\n\nexport type ConnectorMappingType = EngineToConnectorMapping | ConnectorToEngineMapping;\n\nexport class ConnectorMapping implements EngineToConnectorMapping, ConnectorToEngineMapping {\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any;\n sourceField?: string; // for data source variables\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n direction: any = ConnectorMappingDirection.engineToConnector;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n id?: Id;\n\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource.variable,\n sourceValue: string,\n direction: ConnectorMappingDirection.connectorToEngine,\n );\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction?: ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n );\n constructor(contextProperty: string, mapFrom: ConnectorMappingSource, sourceValue: string | boolean | number);\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction = ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n ) {\n this.name = contextProperty;\n this.direction = direction;\n\n if (mapFrom === ConnectorMappingSource.variable) {\n this.value = `var.${sourceValue}`;\n this.id = sourceValue as Id;\n this.type = ConnectorMappingSource.variable;\n this.sourceField = sourceField;\n } else {\n this.value = sourceValue;\n this.type = ConnectorMappingSource.value;\n }\n }\n}\n\nexport type ConnectorState = {\n id: Id;\n type: ConnectorStateType;\n};\n\nexport type ConnectorEvent = {\n id: Id;\n type: ConnectorEventType;\n};\n\nexport type QueryPage<T> = Omit<QueryResult<T>, 'links'> & {\n nextPageToken?: string;\n};\n\nexport enum ConnectorMappingSource {\n variable = 'var',\n value = 'value',\n}\n\n/**\n * Direction of the Connector Mapping.\n */\nexport enum ConnectorMappingDirection {\n /**\n * Indicates the mapping will propagate a value to the connector. This\n * mapping might cause the linked connector to refresh.\n */\n engineToConnector = 'engineToConnector',\n\n /**\n * Indicates the mapping will propagate a value from inside the connector\n * to the engine. AKA \"reverse mapping\".\n */\n connectorToEngine = 'connectorToEngine',\n}\n\nexport enum ConnectorStateType {\n /**\n * Connector loading process has started.\n * Any SDK methods that required the connector id, will start working now.\n */\n loading = 'loading',\n\n /**\n * Connector loading completed.\n */\n loaded = 'loaded',\n\n /**\n * Connector is running in QuickJS.\n */\n\n running = 'running',\n\n /**\n * Connector is fully configured and has the correct authentication information.\n * At this point the connector is ready to make requests.\n */\n ready = 'ready',\n\n /**\n * Something went wrong, the connector is in error state.\n * Check the error message for more information.\n */\n error = 'error',\n}\n\nexport enum ConnectorEventType {\n /**\n * This event will be triggered by the following state changes of the connector\n * - loading\n * - loaded\n * - running\n * - ready\n * - error\n */\n stateChanged = 'stateChanged',\n\n /**\n * Authentication information is changed\n */\n authChanged = 'authChanged',\n\n /**\n * Connector configuration changed that requires the connector to be reloaded in QuickJS.\n * This will trigger multiple 'stateChanged' events while it is reloading.\n * Wait until 'ready'-stateChanged event is received to start using the connector again.\n */\n reloadRequired = 'reloadRequired',\n\n /**\n * Connector is unregistered and no longer exists inside the editor engine.\n * Don't use the 'connectorId' after receiving this event.\n */\n unloaded = 'unloaded',\n}\n\n/**\n * Hardcoded grafx media connector until we get it from the environment.\n */\nexport const grafxMediaConnectorRegistration: ConnectorLocalRegistration = {\n url: 'grafx-media.json',\n source: ConnectorRegistrationSource.local,\n};\n\n/**\n * Grafx token to return to the engine when it expires.\n */\nexport class GrafxTokenAuthCredentials {\n token: string;\n type = AuthCredentialsTypeEnum.grafxToken;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(token: string, headers?: Record<string, string>) {\n this.token = token;\n this.headers = headers;\n }\n}\n\n/**\n * Notification to return to the engine whenever a 3rd party auth (user impersonation)\n * has been renewed by the integration.\n */\nexport class RefreshedAuthCredendentials {\n type = AuthCredentialsTypeEnum.refreshed;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(headers?: Record<string, string>) {\n this.headers = headers;\n }\n}\n\nexport enum AuthCredentialsTypeEnum {\n grafxToken = 'grafxToken',\n refreshed = 'refreshed',\n}\n\nexport type AuthCredentials = GrafxTokenAuthCredentials | RefreshedAuthCredendentials;\n\nexport enum AuthRefreshTypeEnum {\n grafxToken = 'grafxToken',\n any = 'any',\n}\n\nexport type GrafxAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.grafxToken;\n};\n\n/**\n * @param connectorId connector id\n * @param remoteConnectorId remote connector id\n * @param headerValue the value of the X-GRAFX-UNAUTHORIZED header. This\n * will notify that the dam authentication expired if it went through the\n * proxy.\n * Example: \"Static, 1234\", \"OAuthClientCredentials, 5678\"\n * If the http request did not go through the proxy, headerValue is null.\n */\nexport type AnyAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.any;\n connectorId: Id;\n remoteConnectorId: Id;\n headerValue: string | null;\n connectorDefinition: ConnectorDefinition;\n};\n\nexport type AuthRefreshRequest = GrafxAuthRefreshRequest | AnyAuthRefreshRequest;\n\nexport type ConnectorOptions = ContextDictionary;\nexport type MetaData = ContextDictionary;\n\nexport type UploadValidationConfiguration = {\n minWidthPixels?: number | null;\n maxWidthPixels?: number | null;\n minHeightPixels?: number | null;\n maxHeightPixels?: number | null;\n mimeTypes?: string[];\n};\n\nexport enum UploadAssetValidationErrorType {\n minDimension = 'minDimension',\n}\n\nexport class UploadAssetValidationError extends Error {\n constructor(message: string, public type: UploadAssetValidationErrorType) {\n super(message);\n }\n}\n\nexport enum ConnectorSupportedAuth {\n StaticKey = 'staticKey',\n OAuth2ClientCredentials = 'oAuth2ClientCredentials',\n OAuth2AuthorizationCode = 'oAuth2AuthorizationCode',\n OAuth2ResourceOwnerPassword = 'oAuth2ResourceOwnerPassword',\n OAuth2JwtBearer = 'oAuth2JwtBearer',\n None = 'none',\n}\n\ninterface ConnectorDefinition {\n id: Id;\n name: string;\n type: ConnectorType;\n supportedAuthentication: { browser: ConnectorSupportedAuth[]; server: ConnectorSupportedAuth[] };\n externalSourceId?: string | null;\n}\n"],"names":["DeprecatedMediaType","DeprecatedMediaConnectorDownloadType","MediaType","ConnectorType","SortBy","SortOrder","ConnectorConfigValueType","ConnectorConfigContextType","ConnectorRegistrationSource","ConnectorMappingSource","ConnectorMappingDirection","ConnectorStateType","ConnectorEventType","AuthCredentialsTypeEnum","AuthRefreshTypeEnum","UploadAssetValidationErrorType","ConnectorSupportedAuth"],"mappings":"AAUO,IAAK,wCAAAA,yBAAL;AACHA,uBAAAA,qBAAA,UAAO,CAAA,IAAP;AACAA,uBAAAA,qBAAA,gBAAa,CAAA,IAAb;AAFQ,S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YAAA,IAAa;AACbA,2BAAA,WAAA,IAAY;AAFJ,SAAAA;AAAA,GAAA,2BAAA,CAAA,CAAA;AAOL,IAAK,wCAAAC,yBAAL;AACHA,uBAAA,YAAA,IAAa;AACbA,uBAAA,KAAA,IAAM;AAFE,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAuCL,IAAK,mDAAAC,oCAAL;AACHA,kCAAA,cAAA,IAAe;AADP,SAAAA;AAAA,GAAA,kCAAA,CAAA,CAAA;AAIL,MAAM,mCAAmC,MAAM;AAAA,EAClD,YAAY,SAAwB,MAAsC;AACtE,UAAM,OAAO;AADmB,SAAA,OAAA;AAAA,EAEpC;AACJ;AAEO,IAAK,2CAAAC,4BAAL;AACHA,0BAAA,WAAA,IAAY;AACZA,0BAAA,yBAAA,IAA0B;AAC1BA,0BAAA,yBAAA,IAA0B;AAC1BA,0BAAA,6BAAA,IAA8B;AAC9BA,0BAAA,iBAAA,IAAkB;AAClBA,0BAAA,MAAA,IAAO;AANC,SAAAA;AAAA,GAAA,0BAAA,CAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"ConnectorTypes.es.js","sources":["../../../src/types/ConnectorTypes.ts"],"sourcesContent":["import type {\n Dictionary as ContextDictionary,\n ConnectorConfigOptions as GenericConnectorConfigOptions,\n ConnectorConfigValue as GenericConnectorConfigValue,\n QueryPage as QueryResult,\n} from '@chili-studio/connector-types';\nimport { Id } from './CommonTypes';\n\nexport type { FilePointer, QueryOptions } from '@chili-studio/connector-types';\n\nexport enum DeprecatedMediaType {\n file = 0,\n collection = 1,\n}\n\nexport enum DeprecatedMediaConnectorDownloadType {\n LowResolutionWeb = 'lowresWeb',\n HighResolutionWeb = 'highresWeb',\n}\n\nexport enum MediaType {\n file = 'file',\n collection = 'collection',\n}\n\nexport enum ConnectorType {\n media = 'media',\n fonts = 'fonts',\n data = 'data',\n /**\n * @experimental This is still experimental and might change in future releases.\n */\n components = 'components',\n}\n\nexport enum SortBy {\n name = 'name',\n path = 'relativePath',\n id = 'id',\n}\n\nexport enum SortOrder {\n ascending = 'asc',\n descending = 'desc',\n}\n\nexport enum ConnectorConfigValueType {\n text = 'text',\n boolean = 'boolean',\n number = 'number',\n}\n\nexport enum ConnectorConfigContextType {\n query = 'query',\n upload = 'upload',\n}\n\nexport type ConnectorConfigValue = GenericConnectorConfigValue<ConnectorConfigValueType, ConnectorConfigContextType>;\nexport type ConnectorConfigOptions = GenericConnectorConfigOptions<\n ConnectorConfigValueType,\n ConnectorConfigContextType\n>;\n\ninterface ConnectorRegistrationBase {\n /**\n * Url to the connector.\n *\n * - If source is `url`, this must be a publicly accessible url.\n *\n * - If source is `grafx`, this must be the full url to the connector GET endpoint on GraFx Environment API.\n */\n url: string;\n\n /**\n * Connector source type.\n */\n source: ConnectorRegistrationSource;\n}\n\nexport interface ConnectorUrlRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.url;\n}\n\nexport interface ConnectorGrafxRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.grafx;\n}\n\nexport interface ConnectorLocalRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.local;\n}\n\nexport type ConnectorRegistration = ConnectorUrlRegistration | ConnectorGrafxRegistration | ConnectorLocalRegistration;\n\nexport type ConnectorInstance = {\n id: Id;\n name: string;\n iconUrl: string;\n source: ConnectorRegistration;\n};\n\nexport enum ConnectorRegistrationSource {\n /**\n * Connector is hosted on a publicly accessible link.\n */\n url = 'url',\n\n /**\n * Connector is hosted on GraFx Environment API.\n */\n grafx = 'grafx',\n\n /**\n * Connector is embedded in the document.\n * Note: This is a temporary type; only to be used internally.\n */\n local = 'local',\n}\n\nexport interface EngineToConnectorMapping {\n name: string;\n value: ContextDictionary[keyof ContextDictionary];\n id?: Id;\n sourceField?: string; // for data source variables\n type: ConnectorMappingSource;\n direction: ConnectorMappingDirection.engineToConnector;\n}\n\nexport interface ConnectorToEngineMapping {\n name: string;\n /** @deprecated Use id instead. This property holds a string representation of the id in the form: var.<id> */\n value: string;\n id?: Id;\n type: ConnectorMappingSource.variable;\n direction: ConnectorMappingDirection.connectorToEngine;\n}\n\nexport type ConnectorMappingType = EngineToConnectorMapping | ConnectorToEngineMapping;\n\nexport class ConnectorMapping implements EngineToConnectorMapping, ConnectorToEngineMapping {\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any;\n sourceField?: string; // for data source variables\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n direction: any = ConnectorMappingDirection.engineToConnector;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n id?: Id;\n\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource.variable,\n sourceValue: string,\n direction: ConnectorMappingDirection.connectorToEngine,\n );\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction?: ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n );\n constructor(contextProperty: string, mapFrom: ConnectorMappingSource, sourceValue: string | boolean | number);\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction = ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n ) {\n this.name = contextProperty;\n this.direction = direction;\n\n if (mapFrom === ConnectorMappingSource.variable) {\n this.value = `var.${sourceValue}`;\n this.id = sourceValue as Id;\n this.type = ConnectorMappingSource.variable;\n this.sourceField = sourceField;\n } else {\n this.value = sourceValue;\n this.type = ConnectorMappingSource.value;\n }\n }\n}\n\nexport type ConnectorState = {\n id: Id;\n type: ConnectorStateType;\n};\n\nexport type ConnectorEvent = {\n id: Id;\n type: ConnectorEventType;\n};\n\nexport type QueryPage<T> = Omit<QueryResult<T>, 'links'> & {\n nextPageToken?: string;\n};\n\nexport enum ConnectorMappingSource {\n variable = 'var',\n value = 'value',\n}\n\n/**\n * Direction of the Connector Mapping.\n */\nexport enum ConnectorMappingDirection {\n /**\n * Indicates the mapping will propagate a value to the connector. This\n * mapping might cause the linked connector to refresh.\n */\n engineToConnector = 'engineToConnector',\n\n /**\n * Indicates the mapping will propagate a value from inside the connector\n * to the engine. AKA \"reverse mapping\".\n */\n connectorToEngine = 'connectorToEngine',\n}\n\nexport enum ConnectorStateType {\n /**\n * Connector loading process has started.\n * Any SDK methods that required the connector id, will start working now.\n */\n loading = 'loading',\n\n /**\n * Connector loading completed.\n */\n loaded = 'loaded',\n\n /**\n * Connector is running in QuickJS.\n */\n\n running = 'running',\n\n /**\n * Connector is fully configured and has the correct authentication information.\n * At this point the connector is ready to make requests.\n */\n ready = 'ready',\n\n /**\n * Something went wrong, the connector is in error state.\n * Check the error message for more information.\n */\n error = 'error',\n}\n\nexport enum ConnectorEventType {\n /**\n * This event will be triggered by the following state changes of the connector\n * - loading\n * - loaded\n * - running\n * - ready\n * - error\n */\n stateChanged = 'stateChanged',\n\n /**\n * Authentication information is changed\n */\n authChanged = 'authChanged',\n\n /**\n * Connector configuration changed that requires the connector to be reloaded in QuickJS.\n * This will trigger multiple 'stateChanged' events while it is reloading.\n * Wait until 'ready'-stateChanged event is received to start using the connector again.\n */\n reloadRequired = 'reloadRequired',\n\n /**\n * Connector is unregistered and no longer exists inside the editor engine.\n * Don't use the 'connectorId' after receiving this event.\n */\n unloaded = 'unloaded',\n}\n\n/**\n * Hardcoded grafx media connector until we get it from the environment.\n */\nexport const grafxMediaConnectorRegistration: ConnectorLocalRegistration = {\n url: 'grafx-media.json',\n source: ConnectorRegistrationSource.local,\n};\n\n/**\n * Grafx token to return to the engine when it expires.\n */\nexport class GrafxTokenAuthCredentials {\n token: string;\n type = AuthCredentialsTypeEnum.grafxToken;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(token: string, headers?: Record<string, string>) {\n this.token = token;\n this.headers = headers;\n }\n}\n\n/**\n * Notification to return to the engine whenever a 3rd party auth (user impersonation)\n * has been renewed by the integration.\n */\nexport class RefreshedAuthCredendentials {\n type = AuthCredentialsTypeEnum.refreshed;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(headers?: Record<string, string>) {\n this.headers = headers;\n }\n}\n\nexport enum AuthCredentialsTypeEnum {\n grafxToken = 'grafxToken',\n refreshed = 'refreshed',\n}\n\nexport type AuthCredentials = GrafxTokenAuthCredentials | RefreshedAuthCredendentials;\n\nexport enum AuthRefreshTypeEnum {\n grafxToken = 'grafxToken',\n any = 'any',\n}\n\nexport type GrafxAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.grafxToken;\n};\n\n/**\n * @param connectorId connector id\n * @param remoteConnectorId remote connector id\n * @param headerValue the value of the X-GRAFX-UNAUTHORIZED header. This\n * will notify that the dam authentication expired if it went through the\n * proxy.\n * Example: \"Static, 1234\", \"OAuthClientCredentials, 5678\"\n * If the http request did not go through the proxy, headerValue is null.\n */\nexport type AnyAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.any;\n connectorId: Id;\n remoteConnectorId: Id;\n headerValue: string | null;\n connectorDefinition: ConnectorDefinition;\n};\n\nexport type AuthRefreshRequest = GrafxAuthRefreshRequest | AnyAuthRefreshRequest;\n\nexport type ConnectorOptions = ContextDictionary;\nexport type MetaData = ContextDictionary;\n\nexport type UploadValidationConfiguration = {\n minWidthPixels?: number | null;\n maxWidthPixels?: number | null;\n minHeightPixels?: number | null;\n maxHeightPixels?: number | null;\n mimeTypes?: string[];\n};\n\nexport enum UploadAssetValidationErrorType {\n minDimension = 'minDimension',\n}\n\nexport class UploadAssetValidationError extends Error {\n constructor(\n message: string,\n public type: UploadAssetValidationErrorType,\n ) {\n super(message);\n }\n}\n\nexport enum ConnectorSupportedAuth {\n StaticKey = 'staticKey',\n OAuth2ClientCredentials = 'oAuth2ClientCredentials',\n OAuth2AuthorizationCode = 'oAuth2AuthorizationCode',\n OAuth2ResourceOwnerPassword = 'oAuth2ResourceOwnerPassword',\n OAuth2JwtBearer = 'oAuth2JwtBearer',\n None = 'none',\n}\n\ninterface ConnectorDefinition {\n id: Id;\n name: string;\n type: ConnectorType;\n supportedAuthentication: { browser: ConnectorSupportedAuth[]; server: ConnectorSupportedAuth[] };\n externalSourceId?: string | null;\n}\n"],"names":["DeprecatedMediaType","DeprecatedMediaConnectorDownloadType","MediaType","ConnectorType","SortBy","SortOrder","ConnectorConfigValueType","ConnectorConfigContextType","ConnectorRegistrationSource","ConnectorMappingSource","ConnectorMappingDirection","ConnectorStateType","ConnectorEventType","AuthCredentialsTypeEnum","AuthRefreshTypeEnum","UploadAssetValidationErrorType","ConnectorSupportedAuth"],"mappings":"AAUO,IAAK,wCAAAA,yBAAL;AACHA,uBAAAA,qBAAA,UAAO,CAAA,IAAP;AACAA,uBAAAA,qBAAA,gBAAa,CAAA,IAAb;AAFQ,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAKL,IAAK,yDAAAC,0CAAL;AACHA,wCAAA,kBAAA,IAAmB;AACnBA,wCAAA,mBAAA,IAAoB;AAFZ,SAAAA;AAAA,GAAA,wCAAA,CAAA,CAAA;AAKL,IAAK,8BAAAC,eAAL;AACHA,aAAA,MAAA,IAAO;AACPA,aAAA,YAAA,IAAa;AAFL,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAKL,IAAK,kCAAAC,mBAAL;AACHA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,MAAA,IAAO;AAIPA,iBAAA,YAAA,IAAa;AAPL,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AAUL,IAAK,2BAAAC,YAAL;AACHA,UAAA,MAAA,IAAO;AACPA,UAAA,MAAA,IAAO;AACPA,UAAA,IAAA,IAAK;AAHG,SAAAA;AAAA,GAAA,UAAA,CAAA,CAAA;AAML,IAAK,8BAAAC,eAAL;AACHA,aAAA,WAAA,IAAY;AACZA,aAAA,YAAA,IAAa;AAFL,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAKL,IAAK,6CAAAC,8BAAL;AACHA,4BAAA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esDto\nimport { BarcodeCharacterSet, BarcodeErrorCorrectionLevel, BarcodeType, QuietZone } from './BarcodeTypes';\nimport { ColorUsage } from './ColorStyleTypes';\nimport { HasOverrideState, Id, PropertyState } from './CommonTypes';\nimport { GradientUsage } from './GradientStyleTypes';\nimport { ComponentGridSettings } from '../types/ComponentGridTypes';\nimport {\n CornerRadiusAll,\n CornerRadiusNone,\n CornerRadiusOnly,\n ShapeFrameSource,\n ShapeType,\n ShapeContainerProperties,\n} from './ShapeTypes';\n\nexport type FrameLayoutType = {\n id: Id;\n layoutId: Id;\n horizontal: FrameAnchor;\n vertical: FrameAnchor;\n x: PropertyState<number>;\n y: PropertyState<number>;\n width: PropertyState<number>;\n height: PropertyState<number>;\n rotationDegrees: PropertyState<number>;\n scaleX: PropertyState<number>;\n scaleY: PropertyState<number>;\n isVisible: PropertyState<boolean>;\n fitMode: PropertyState<FitMode>;\n fitModePosition: PropertyState<FitModePosition>;\n smartCropSettings: PropertyState<SmartCropSettings>;\n hasImageCrop: PropertyState<boolean>;\n hasFrameSubjectArea: PropertyState<boolean>;\n minCopyfitting: PropertyState<number>;\n maxCopyfitting: PropertyState<number>;\n enableCopyfitting: PropertyState<boolean>;\n autoGrow: AutoGrowSettings;\n isShowingCustomCroppedAsset: boolean;\n customCroppedAssetCount: number;\n subjectId: PropertyState<Id | null>;\n componentGridSettings: PropertyState<ComponentGridSettings>;\n componentFit: PropertyState<ComponentFitEnum>;\n} | null;\n\n//Frame.image\nexport type FrameType = {\n id: Id;\n name: string;\n type: FrameTypeEnum;\n // `imageUrl` is not generic: should be removed from model\n imageUrl: string;\n blendMode: string;\n opacity: number;\n};\n\nexport type Frame = TextFrame | ImageFrame | ShapeFrame | BarcodeFrame | ComponentFrame | ComponentGridFrame;\n\nexport type ImageFrameVariableSource = {\n type: ImageSourceTypeEnum.variable;\n id: Id;\n};\n\nexport type ImageFrameUrlSource = {\n type: ImageSourceTypeEnum.url;\n url: string;\n};\n\nexport type ImageFrameConnectorSource = {\n type: ImageSourceTypeEnum.connector;\n assetId: Id;\n id: Id;\n};\n\nexport type ImageFrameBrandkitMediaSource = {\n type: ImageSourceTypeEnum.brandKitMedia;\n name: string;\n};\n\nexport type ImageFrameSource =\n | ImageFrameConnectorSource\n | ImageFrameVariableSource\n | ImageFrameUrlSource\n | ImageFrameBrandkitMediaSource;\n\n// used by new getter methods\nexport type ImageFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.image;\n src?: ImageFrameSource;\n blendMode: BlendMode;\n dropShadowSettings?: DropShadowSettings;\n container: {\n source: ShapeFrameSource;\n properties: ShapeContainerProperties;\n };\n};\n\nexport type ShapeFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.shape;\n blendMode: BlendMode;\n shapeProperties: {\n enableFill: boolean;\n fillColor: ColorUsage;\n enableStroke: boolean;\n strokeWeight: number;\n strokeColor: ColorUsage;\n allCornersSame: boolean;\n };\n src: {\n type: ShapeType;\n cornerRadius: CornerRadiusNone | CornerRadiusAll | CornerRadiusOnly;\n sides?: number;\n };\n dropShadowSettings?: DropShadowSettings;\n gradient?: GradientUsage;\n};\n\nexport type TextFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.text;\n textContent: string;\n paddingLeft: number;\n paddingTop: number;\n paddingRight: number;\n paddingBottom: number;\n numberOfColumns: number;\n columnGap: number;\n textDirection: TextDirection;\n flowDirection: FlowDirection;\n verticalAlign: VerticalAlign;\n textStroke: boolean;\n textStrokeWeight: number;\n textStrokeColor: number;\n hasClippingPath: boolean;\n blendMode: BlendMode;\n dropShadowSettings?: DropShadowSettings;\n hasVariable?: boolean;\n};\n\nexport type BarcodeFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.barcode;\n blendMode: BlendMode;\n barcodeProperties: {\n enableBackground: boolean;\n backgroundColor: ColorUsage;\n enableBarColor: boolean;\n barColor: ColorUsage;\n enableText: boolean;\n barHeight: number;\n magnification: number;\n quietZone: QuietZone;\n errorCorrectionLevel?: BarcodeErrorCorrectionLevel;\n characterSet?: BarcodeCharacterSet;\n drawStartStopChars: boolean;\n };\n src?: BarcodeSource;\n barcodeType: BarcodeType;\n dropShadowSettings?: DropShadowSettings;\n};\n\nexport type BarcodeSource = BarcodeVariableSource | BarcodeTextSource;\n\nexport type BarcodeVariableSource = {\n type: BarcodeSourceTypeEnum.variable;\n id: Id;\n};\n\nexport type BarcodeTextSource = {\n type: BarcodeSourceTypeEnum.text;\n text: string;\n};\n\nexport type ComponentFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.component;\n blendMode: BlendMode;\n src: ComponentSource;\n variableMappings: VariableMapping[];\n\n /**\n * @deprecated Use `componentFit` on frame properties instead. This property is deprecated and will be removed in a future version.\n * How the component fits within the frame.\n */\n fitMode: ComponentFitEnum;\n};\n\nexport type ComponentGridFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.componentGrid;\n blendMode: BlendMode;\n dataSourceVariableId?: Id | null;\n src?: ComponentSource | null;\n variableMappings: GridVariableMapping;\n};\n\nexport type GridVariableMapping = {\n mappings: Record<string, VariableMapping[] | null>;\n};\n\nexport type ComponentSource = ConnectorComponentSource;\n\nexport type ConnectorComponentSource = {\n type: ComponentSourceTypeEnum.connector;\n id: Id;\n assetId: Id | null;\n};\n\nexport type VariableMapping = {\n source: Id;\n target: Id;\n sourceField?: string;\n};\n\nexport enum ComponentFitEnum {\n /**\n * The component resizes to fit the frame size.\n */\n resize = 'resize',\n\n /**\n * The component scales to fit the frame size while maintaining its aspect ratio.\n */\n scale = 'scale',\n\n /**\n * The component first scales to fit the frame size while maintaining its aspect ratio,\n * then resizes to fill the remaining space.\n */\n scaleAndResize = 'scaleAndResize',\n}\n\nexport type CropSettings = {\n left: number;\n top: number;\n width: number;\n height: number;\n rotationDegrees: number;\n type: 'default';\n};\n\nexport type NoCropSettings = {\n type: 'noCrop';\n};\n\nexport type AutoGrowSettings = {\n enabled: PropertyState<boolean>;\n minWidth: PropertyState<number>;\n maxWidth: PropertyState<number>;\n minHeight: PropertyState<number>;\n maxHeight: PropertyState<number>;\n directions: PropertyState<Array<AutoGrowDirection>>;\n};\n\nexport interface AutoGrowDeltaUpdate {\n enabled?: {\n value: boolean;\n };\n minWidth?: {\n value: string | null;\n };\n maxWidth?: {\n value: string | null;\n };\n minHeight?: {\n value: string | null;\n };\n maxHeight?: {\n value: string | null;\n };\n directions?: {\n value: Array<AutoGrowDirection>;\n };\n}\n\nexport type DropShadowSettings = {\n enabled: boolean;\n distance: number;\n angleDegrees: number;\n blurRadius: number;\n color: ColorUsage;\n};\n\nexport interface ShadowSettingsDeltaUpdate {\n distance?: {\n value: string;\n };\n angleDegrees?: {\n value: number;\n };\n blurRadius?: {\n value: number;\n };\n enabled?: {\n value: boolean;\n };\n color?: {\n value: ColorUsage;\n };\n}\n\nexport enum AutoGrowDirection {\n top = 'top',\n bottom = 'bottom',\n left = 'left',\n right = 'right',\n}\n\nexport enum ImageSourceTypeEnum {\n url = 'url',\n variable = 'variable',\n connector = 'connector',\n brandKitMedia = 'brandKitMedia',\n}\n\nexport enum ComponentSourceTypeEnum {\n connector = 'connector',\n}\n\nexport enum FrameTypeEnum {\n text = 'text',\n image = 'image',\n shape = 'shape',\n barcode = 'barcode',\n component = 'component',\n componentGrid = 'componentGrid',\n}\n\nexport enum BarcodeSourceTypeEnum {\n variable = 'variable',\n text = 'text',\n}\n\nexport enum TextDirection {\n leftToRight = 'leftToRight',\n rightToLeft = 'rightToLeft',\n weak = 'weak',\n}\n\nexport enum FlowDirection {\n horizontal = 'horizontal',\n vertical = 'vertical',\n onPath = 'onPath',\n}\n\nexport enum VerticalAlign {\n top = 'top',\n bottom = 'bottom',\n middle = 'middle',\n justify = 'justify',\n}\n\nexport enum BlendMode {\n normal = 'normal',\n screen = 'screen',\n overlay = 'overlay',\n darken = 'darken',\n lighten = 'lighten',\n colorDodge = 'colorDodge',\n colorBurn = 'colorBurn',\n hardLight = 'hardLight',\n softLight = 'softLight',\n difference = 'difference',\n exclusion = 'exclusion',\n multiply = 'multiply',\n hue = 'hue',\n saturation = 'saturation',\n color = 'color',\n luminosity = 'luminosity',\n}\n\nexport enum FitMode {\n fill = 'fill',\n fit = 'fit',\n smartCrop = 'smartCrop',\n manualCrop = 'manualCrop',\n}\n\nexport enum FitModePosition {\n topLeft = 'topLeft',\n topCenter = 'topCenter',\n topRight = 'topRight',\n centerLeft = 'centerLeft',\n center = 'center',\n centerRight = 'centerRight',\n bottomLeft = 'bottomLeft',\n bottomCenter = 'bottomCenter',\n bottomRight = 'bottomRight',\n}\n\nexport enum UpdateZIndexMethod {\n bringToFront = 'bringToFront',\n sendToBack = 'sendToBack',\n bringForward = 'bringForward',\n sendBackward = 'sendBackward',\n}\n\nexport enum FrameAnchorType {\n relative = 'relative',\n start = 'start',\n end = 'end',\n startAndEnd = 'startAndEnd',\n center = 'center',\n}\n\nexport enum AnchorTargetType {\n page = 'page',\n frame = 'frame',\n}\n\nexport enum AnchorTargetEdgeType {\n start = 'start',\n end = 'end',\n center = 'center',\n}\n\nexport class PageAnchorTarget {\n type = AnchorTargetType.page;\n}\n\nexport class FrameAnchorTarget {\n frameId: Id;\n edge: AnchorTargetEdgeType;\n type = AnchorTargetType.frame;\n\n constructor(id: Id, edge: AnchorTargetEdgeType) {\n (this.frameId = id), (this.edge = edge);\n }\n}\n\nexport type AnchorTarget = PageAnchorTarget | FrameAnchorTarget;\n\nexport type RelativeFrameAnchor = {\n start: PropertyState<number>;\n end: PropertyState<number>;\n target: AnchorTarget;\n type: FrameAnchorType.relative;\n} & HasOverrideState;\n\nexport type StartFrameAnchor = {\n offset: PropertyState<number>;\n target: AnchorTarget;\n type: FrameAnchorType.start;\n} & HasOverrideState;\n\nexport type EndFrameAnchor = {\n offset: PropertyState<number>;\n target: AnchorTarget;\n type: FrameAnchorType.end;\n} & HasOverrideState;\n\nexport type StartAndEndFrameAnchor = {\n start: PropertyState<number>;\n startTarget: AnchorTarget;\n end: PropertyState<number>;\n endTarget: AnchorTarget;\n type: FrameAnchorType.startAndEnd;\n} & HasOverrideState;\n\nexport type CenterFrameAnchor = {\n offset: PropertyState<number>;\n target: AnchorTarget;\n type: FrameAnchorType.center;\n} & HasOverrideState;\n\nexport type FrameAnchor =\n | RelativeFrameAnchor\n | StartFrameAnchor\n | EndFrameAnchor\n | StartAndEndFrameAnchor\n | CenterFrameAnchor;\n\nexport type FrameAnchorProperties = {\n horizontal: boolean;\n type: FrameAnchorType;\n target: AnchorTarget;\n endTarget?: AnchorTarget | null;\n};\n\nexport type AnchorConfiguration = {\n allowedTypes: Set<FrameAnchorType>;\n allowedFrameIds: Set<Id>;\n};\n\nexport type FrameConfiguration = {\n horizontal: AnchorConfiguration;\n vertical: AnchorConfiguration;\n};\n\nexport enum CropType {\n frameCrop = 'frameCrop',\n assetCrop = 'assetCrop',\n}\n\n/**\n * Image-specific editing constraints.\n */\nexport type ImageFrameConstraints = {\n cropAllowed: PropertyState<boolean>;\n};\n\n/**\n * Text-specific editing constraints.\n */\nexport type TextFrameConstraints = {\n editingAllowed: PropertyState<boolean>;\n paragraphStyles: PropertyState<IdSetManagedConstraint>;\n characterStyles: PropertyState<IdSetManagedConstraint>;\n colors: PropertyState<IdSetManagedConstraint>;\n fontSizes: PropertyState<FontSizeRangeManagedConstraint>;\n};\n\nexport interface ManagedConstraint {\n allowed: boolean;\n}\n\n/**\n * A managed constraint represented by a set of allowed Id identifiers.\n *\n * Example: used to allow only a specific set of paragraph or character styles.\n * - `allowed`: If true, only the provided `ids` may be used.\n * - `ids`: The set of allowed Id values.\n */\nexport interface IdSetManagedConstraint extends ManagedConstraint {\n allowed: boolean;\n ids: Id[];\n}\n\n/**\n * A managed constraint that restricts allowed font sizes to a continuous range.\n *\n * - `allowed`: If true, restricts allowed font sizes to [min, max] (inclusive).\n * - `min`: The minimum allowed font size (nullable).\n * - `max`: The maximum allowed font size (nullable).\n */\nexport interface FontSizeRangeManagedConstraint extends ManagedConstraint {\n allowed: boolean;\n min: number | null;\n max: number | null;\n}\n\n/**\n * Frame editing constraints with optional frame-type-specific sub-properties.\n */\nexport type FrameConstraints = {\n selectionAllowed: PropertyState<boolean>;\n horizontalMovementAllowed: PropertyState<boolean>;\n verticalMovementAllowed: PropertyState<boolean>;\n rotationAllowed: PropertyState<boolean>;\n resizeAllowed: PropertyState<boolean>;\n proportionLocked: PropertyState<boolean>;\n /** Image-specific constraints. */\n image?: ImageFrameConstraints;\n /** Text-specific constraints. */\n text?: TextFrameConstraints;\n};\n\n/**\n * Image-specific constraints delta update.\n */\nexport interface ImageFrameConstraintsDeltaUpdate {\n cropAllowed?: {\n value: boolean;\n };\n}\n\n/**\n * Text-specific constraints delta update.\n */\nexport interface TextFrameConstraintsDeltaUpdate {\n editingAllowed?: {\n value: boolean;\n };\n paragraphStyles?: {\n value: IdSetManagedConstraint;\n };\n characterStyles?: {\n value: IdSetManagedConstraint;\n };\n colors?: {\n value: IdSetManagedConstraint;\n };\n fontSizes?: {\n value: FontSizeRangeManagedConstraint;\n };\n}\n\n/**\n * Frame constraints delta update with optional frame-type-specific sub-properties.\n */\nexport interface FrameConstraintsDeltaUpdate {\n selectionAllowed?: {\n value: boolean;\n };\n horizontalMovementAllowed?: {\n value: boolean;\n };\n verticalMovementAllowed?: {\n value: boolean;\n };\n rotationAllowed?: {\n value: boolean;\n };\n resizeAllowed?: {\n value: boolean;\n };\n proportionLocked?: {\n value: boolean;\n };\n /** Image-specific constraints update. */\n image?: ImageFrameConstraintsDeltaUpdate;\n /** Text-specific constraints update. */\n text?: TextFrameConstraintsDeltaUpdate;\n}\n\nexport type SmartCropSettings = SmartCropSettingsV1 | SmartCropSettingsV2;\n\nexport type SmartCropSettingsV1 = {\n version: SmartCropVersion.v1;\n};\n\nexport type SmartCropSettingsV2 = {\n version: SmartCropVersion.v2;\n horizontalBias: SmartCropAxisBias;\n verticalBias: SmartCropAxisBias;\n};\n\nexport enum SmartCropVersion {\n v1 = 'v1',\n v2 = 'v2',\n}\n\n/**\n * Latest version of the smart crop algorithm.\n * Keep in sync with @SmartCropVersion enum.\n */\nexport const LATEST_SMART_CROP_VERSION = SmartCropVersion.v2;\n\nexport enum SmartCropAxisBias {\n start = 'start',\n center = 'center',\n end = 'end',\n}\n"],"names":["ComponentFitEnum","AutoGrowDirection","ImageSourceTypeEnum","ComponentSourceTypeEnum","FrameTypeEnum","BarcodeSourceTypeEnum","TextDirection","FlowDirection","VerticalAlign","BlendMode","FitMode","FitModePosition","UpdateZIndexMethod","FrameAnchorType","AnchorTargetType","AnchorTargetEdgeType","CropType","SmartCropVersion","SmartCropAxisBias"],"mappings":";;AAmOO,IAAK,qCAAAA,sBAAL;AAIHA,oBAAA,QAAA,IAAS;AAKTA,oBAAA,OAAA,IAAQ;AAMRA,oBAAA,gBAAA,IAAiB;AAfT,SAAAA;AAAA,GAAA,oBAAA,CAAA,CAAA;AAuFL,IAAK,sCAAAC,uBAAL;AACHA,qBAAA,KAAA,IAAM;AACNA,qBAAA,QAAA,IAAS;AACTA,qBAAA,MAAA,IAAO;AACPA,qBAAA,OAAA,IAAQ;AAJA,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;AAOL,IAAK,wCAAAC,yBAAL;AACHA,uBAAA,KAAA,IAAM;AACNA,uBAAA,UAAA,IAAW;AACXA,uBAAA,WAAA,IAAY;AACZA,uBAAA,eAAA,IAAgB;AAJR,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAOL,IAAK,4CAAAC,6BAAL;AACHA,2BAAA,WAAA,IAAY;AADJ,SAAAA;AAAA,GAAA,2BAAA,CAAA,CAAA;AAIL,IAAK,kCAAAC,mBAAL;AACHA,iBAAA,MAAA,IAAO;AACPA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,SAAA,IAAU;AACVA,iBAAA,WAAA,IAAY;AACZA,iBAAA,eAAA,IAAgB;AANR,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AASL,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,CAAA;AA0IL,IAAK,qCAAAC,sBAAL;AACHA,oBAAA,IAAA,IAAK;AACLA,oBAAA,IAAA,IAAK;AAFG,SAAAA;AAAA,GAAA,oBAAA,CAAA,CAAA;AASL,MAAM,4BAA4B;AAElC,IAAK,sCAAAC,uBAAL;AACHA,qBAAA,OAAA,IAAQ;AACRA,qBAAA,QAAA,IAAS;AACTA,qBAAA,KAAA,IAAM;AAHE,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"FrameTypes.cjs.js","sources":["../../../src/types/FrameTypes.ts"],"sourcesContent":["// FramePropertiesDto\nimport { BarcodeCharacterSet, BarcodeErrorCorrectionLevel, BarcodeType, QuietZone } from './BarcodeTypes';\nimport { ColorUsage } from './ColorStyleTypes';\nimport { HasOverrideState, Id, PropertyState } from './CommonTypes';\nimport { GradientUsage } from './GradientStyleTypes';\nimport { ComponentGridSettings } from '../types/ComponentGridTypes';\nimport {\n CornerRadiusAll,\n CornerRadiusNone,\n CornerRadiusOnly,\n ShapeFrameSource,\n ShapeType,\n ShapeContainerProperties,\n} from './ShapeTypes';\n\nexport type FrameLayoutType = {\n id: Id;\n layoutId: Id;\n horizontal: FrameAnchor;\n vertical: FrameAnchor;\n x: PropertyState<number>;\n y: PropertyState<number>;\n width: PropertyState<number>;\n height: PropertyState<number>;\n rotationDegrees: PropertyState<number>;\n scaleX: PropertyState<number>;\n scaleY: PropertyState<number>;\n isVisible: PropertyState<boolean>;\n fitMode: PropertyState<FitMode>;\n fitModePosition: PropertyState<FitModePosition>;\n smartCropSettings: PropertyState<SmartCropSettings>;\n hasImageCrop: PropertyState<boolean>;\n hasFrameSubjectArea: PropertyState<boolean>;\n minCopyfitting: PropertyState<number>;\n maxCopyfitting: PropertyState<number>;\n enableCopyfitting: PropertyState<boolean>;\n autoGrow: AutoGrowSettings;\n isShowingCustomCroppedAsset: boolean;\n customCroppedAssetCount: number;\n subjectId: PropertyState<Id | null>;\n componentGridSettings: PropertyState<ComponentGridSettings>;\n componentFit: PropertyState<ComponentFitEnum>;\n} | null;\n\n//Frame.image\nexport type FrameType = {\n id: Id;\n name: string;\n type: FrameTypeEnum;\n // `imageUrl` is not generic: should be removed from model\n imageUrl: string;\n blendMode: string;\n opacity: number;\n};\n\nexport type Frame = TextFrame | ImageFrame | ShapeFrame | BarcodeFrame | ComponentFrame | ComponentGridFrame;\n\nexport type ImageFrameVariableSource = {\n type: ImageSourceTypeEnum.variable;\n id: Id;\n};\n\nexport type ImageFrameUrlSource = {\n type: ImageSourceTypeEnum.url;\n url: string;\n};\n\nexport type ImageFrameConnectorSource = {\n type: ImageSourceTypeEnum.connector;\n assetId: Id;\n id: Id;\n};\n\nexport type ImageFrameBrandkitMediaSource = {\n type: ImageSourceTypeEnum.brandKitMedia;\n name: string;\n};\n\nexport type ImageFrameSource =\n ImageFrameConnectorSource | ImageFrameVariableSource | ImageFrameUrlSource | ImageFrameBrandkitMediaSource;\n\n// used by new getter methods\nexport type ImageFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.image;\n src?: ImageFrameSource;\n blendMode: BlendMode;\n dropShadowSettings?: DropShadowSettings;\n container: {\n source: ShapeFrameSource;\n properties: ShapeContainerProperties;\n };\n};\n\nexport type ShapeFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.shape;\n blendMode: BlendMode;\n shapeProperties: {\n enableFill: boolean;\n fillColor: ColorUsage;\n enableStroke: boolean;\n strokeWeight: number;\n strokeColor: ColorUsage;\n allCornersSame: boolean;\n fillOverprint: boolean;\n strokeOverprint: boolean;\n };\n src: {\n type: ShapeType;\n cornerRadius: CornerRadiusNone | CornerRadiusAll | CornerRadiusOnly;\n sides?: number;\n };\n dropShadowSettings?: DropShadowSettings;\n gradient?: GradientUsage;\n};\n\nexport type TextFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.text;\n textContent: string;\n paddingLeft: number;\n paddingTop: number;\n paddingRight: number;\n paddingBottom: number;\n numberOfColumns: number;\n columnGap: number;\n textDirection: TextDirection;\n flowDirection: FlowDirection;\n verticalAlign: VerticalAlign;\n textStroke: boolean;\n textStrokeWeight: number;\n textStrokeColor: number;\n hasClippingPath: boolean;\n blendMode: BlendMode;\n dropShadowSettings?: DropShadowSettings;\n hasVariable?: boolean;\n};\n\nexport type BarcodeFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.barcode;\n blendMode: BlendMode;\n barcodeProperties: {\n enableBars: boolean;\n enableBackground: boolean;\n backgroundColor: ColorUsage;\n enableBarColor: boolean;\n barColor: ColorUsage;\n enableText: boolean;\n barHeight: number;\n magnification: number;\n quietZone: QuietZone;\n errorCorrectionLevel?: BarcodeErrorCorrectionLevel;\n characterSet?: BarcodeCharacterSet;\n drawStartStopChars: boolean;\n barcodeOverprint: boolean;\n backgroundOverprint: boolean;\n };\n src?: BarcodeSource;\n barcodeType: BarcodeType;\n dropShadowSettings?: DropShadowSettings;\n};\n\nexport type BarcodeSource = BarcodeVariableSource | BarcodeTextSource;\n\nexport type BarcodeVariableSource = {\n type: BarcodeSourceTypeEnum.variable;\n id: Id;\n};\n\nexport type BarcodeTextSource = {\n type: BarcodeSourceTypeEnum.text;\n text: string;\n};\n\nexport type ComponentFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.component;\n blendMode: BlendMode;\n src: ComponentSource;\n variableMappings: VariableMapping[];\n\n /**\n * @deprecated Use `componentFit` on frame properties instead. This property is deprecated and will be removed in a future version.\n * How the component fits within the frame.\n */\n fitMode: ComponentFitEnum;\n};\n\nexport type ComponentGridFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.componentGrid;\n blendMode: BlendMode;\n dataSourceVariableId?: Id | null;\n src?: ComponentSource | null;\n variableMappings: GridVariableMapping;\n};\n\nexport type GridVariableMapping = {\n mappings: Record<string, VariableMapping[] | null>;\n};\n\nexport type ComponentSource = ConnectorComponentSource;\n\nexport type ConnectorComponentSource = {\n type: ComponentSourceTypeEnum.connector;\n id: Id;\n assetId: Id | null;\n};\n\nexport type VariableMapping = {\n source: Id;\n target: Id;\n sourceField?: string;\n};\n\nexport enum ComponentFitEnum {\n /**\n * The component resizes to fit the frame size.\n */\n resize = 'resize',\n\n /**\n * The component scales to fit the frame size while maintaining its aspect ratio.\n */\n scale = 'scale',\n\n /**\n * The component first scales to fit the frame size while maintaining its aspect ratio,\n * then resizes to fill the remaining space.\n */\n scaleAndResize = 'scaleAndResize',\n}\n\nexport type CropSettings = {\n left: number;\n top: number;\n width: number;\n height: number;\n rotationDegrees: number;\n type: 'default';\n};\n\nexport type NoCropSettings = {\n type: 'noCrop';\n};\n\nexport type AutoGrowSettings = {\n enabled: PropertyState<boolean>;\n minWidth: PropertyState<number>;\n maxWidth: PropertyState<number>;\n minHeight: PropertyState<number>;\n maxHeight: PropertyState<number>;\n directions: PropertyState<Array<AutoGrowDirection>>;\n};\n\nexport interface AutoGrowDeltaUpdate {\n enabled?: {\n value: boolean;\n };\n minWidth?: {\n value: string | null;\n };\n maxWidth?: {\n value: string | null;\n };\n minHeight?: {\n value: string | null;\n };\n maxHeight?: {\n value: string | null;\n };\n directions?: {\n value: Array<AutoGrowDirection>;\n };\n}\n\nexport type DropShadowSettings = {\n enabled: boolean;\n distance: number;\n angleDegrees: number;\n blurRadius: number;\n color: ColorUsage;\n};\n\nexport interface ShadowSettingsDeltaUpdate {\n distance?: {\n value: string;\n };\n angleDegrees?: {\n value: number;\n };\n blurRadius?: {\n value: number;\n };\n enabled?: {\n value: boolean;\n };\n color?: {\n value: ColorUsage;\n };\n}\n\nexport enum AutoGrowDirection {\n top = 'top',\n bottom = 'bottom',\n left = 'left',\n right = 'right',\n}\n\nexport enum ImageSourceTypeEnum {\n url = 'url',\n variable = 'variable',\n connector = 'connector',\n brandKitMedia = 'brandKitMedia',\n}\n\nexport enum ComponentSourceTypeEnum {\n connector = 'connector',\n}\n\nexport enum FrameTypeEnum {\n text = 'text',\n image = 'image',\n shape = 'shape',\n barcode = 'barcode',\n component = 'component',\n componentGrid = 'componentGrid',\n}\n\nexport enum BarcodeSourceTypeEnum {\n variable = 'variable',\n text = 'text',\n}\n\nexport enum TextDirection {\n leftToRight = 'leftToRight',\n rightToLeft = 'rightToLeft',\n weak = 'weak',\n}\n\nexport enum FlowDirection {\n horizontal = 'horizontal',\n vertical = 'vertical',\n onPath = 'onPath',\n}\n\nexport enum VerticalAlign {\n top = 'top',\n bottom = 'bottom',\n middle = 'middle',\n justify = 'justify',\n}\n\nexport enum BlendMode {\n normal = 'normal',\n screen = 'screen',\n overlay = 'overlay',\n darken = 'darken',\n lighten = 'lighten',\n colorDodge = 'colorDodge',\n colorBurn = 'colorBurn',\n hardLight = 'hardLight',\n softLight = 'softLight',\n difference = 'difference',\n exclusion = 'exclusion',\n multiply = 'multiply',\n hue = 'hue',\n saturation = 'saturation',\n color = 'color',\n luminosity = 'luminosity',\n}\n\nexport enum FitMode {\n fill = 'fill',\n fit = 'fit',\n smartCrop = 'smartCrop',\n manualCrop = 'manualCrop',\n}\n\nexport enum FitModePosition {\n topLeft = 'topLeft',\n topCenter = 'topCenter',\n topRight = 'topRight',\n centerLeft = 'centerLeft',\n center = 'center',\n centerRight = 'centerRight',\n bottomLeft = 'bottomLeft',\n bottomCenter = 'bottomCenter',\n bottomRight = 'bottomRight',\n}\n\nexport enum UpdateZIndexMethod {\n bringToFront = 'bringToFront',\n sendToBack = 'sendToBack',\n bringForward = 'bringForward',\n sendBackward = 'sendBackward',\n}\n\nexport enum FrameAnchorType {\n relative = 'relative',\n start = 'start',\n end = 'end',\n startAndEnd = 'startAndEnd',\n center = 'center',\n}\n\nexport enum AnchorTargetType {\n page = 'page',\n frame = 'frame',\n}\n\nexport enum AnchorTargetEdgeType {\n start = 'start',\n end = 'end',\n center = 'center',\n}\n\nexport class PageAnchorTarget {\n type = AnchorTargetType.page;\n}\n\nexport class FrameAnchorTarget {\n frameId: Id;\n edge: AnchorTargetEdgeType;\n type = AnchorTargetType.frame;\n\n constructor(id: Id, edge: AnchorTargetEdgeType) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n ((this.frameId = id), (this.edge = edge));\n }\n}\n\nexport type AnchorTarget = PageAnchorTarget | FrameAnchorTarget;\n\nexport type RelativeFrameAnchor = {\n start: PropertyState<number>;\n end: PropertyState<number>;\n target: AnchorTarget;\n type: FrameAnchorType.relative;\n} & HasOverrideState;\n\nexport type StartFrameAnchor = {\n offset: PropertyState<number>;\n target: AnchorTarget;\n type: FrameAnchorType.start;\n} & HasOverrideState;\n\nexport type EndFrameAnchor = {\n offset: PropertyState<number>;\n target: AnchorTarget;\n type: FrameAnchorType.end;\n} & HasOverrideState;\n\nexport type StartAndEndFrameAnchor = {\n start: PropertyState<number>;\n startTarget: AnchorTarget;\n end: PropertyState<number>;\n endTarget: AnchorTarget;\n type: FrameAnchorType.startAndEnd;\n} & HasOverrideState;\n\nexport type CenterFrameAnchor = {\n offset: PropertyState<number>;\n target: AnchorTarget;\n type: FrameAnchorType.center;\n} & HasOverrideState;\n\nexport type FrameAnchor =\n RelativeFrameAnchor | StartFrameAnchor | EndFrameAnchor | StartAndEndFrameAnchor | CenterFrameAnchor;\n\nexport type FrameAnchorProperties = {\n horizontal: boolean;\n type: FrameAnchorType;\n target: AnchorTarget;\n endTarget?: AnchorTarget | null;\n};\n\nexport type AnchorConfiguration = {\n allowedTypes: Set<FrameAnchorType>;\n allowedFrameIds: Set<Id>;\n};\n\nexport type FrameConfiguration = {\n horizontal: AnchorConfiguration;\n vertical: AnchorConfiguration;\n};\n\nexport enum CropType {\n frameCrop = 'frameCrop',\n assetCrop = 'assetCrop',\n}\n\n/**\n * Image-specific editing constraints.\n */\nexport type ImageFrameConstraints = {\n cropAllowed: PropertyState<boolean>;\n};\n\n/**\n * Text-specific editing constraints.\n */\nexport type TextFrameConstraints = {\n editingAllowed: PropertyState<boolean>;\n paragraphStyles: PropertyState<IdSetManagedConstraint>;\n characterStyles: PropertyState<IdSetManagedConstraint>;\n colors: PropertyState<IdSetManagedConstraint>;\n fontSizes: PropertyState<FontSizeRangeManagedConstraint>;\n};\n\nexport interface ManagedConstraint {\n allowed: boolean;\n}\n\n/**\n * A managed constraint represented by a set of allowed Id identifiers.\n *\n * Example: used to allow only a specific set of paragraph or character styles.\n * - `allowed`: If true, only the provided `ids` may be used.\n * - `ids`: The set of allowed Id values.\n */\nexport interface IdSetManagedConstraint extends ManagedConstraint {\n allowed: boolean;\n ids: Id[];\n}\n\n/**\n * A managed constraint that restricts allowed font sizes to a continuous range.\n *\n * - `allowed`: If true, restricts allowed font sizes to [min, max] (inclusive).\n * - `min`: The minimum allowed font size (nullable).\n * - `max`: The maximum allowed font size (nullable).\n */\nexport interface FontSizeRangeManagedConstraint extends ManagedConstraint {\n allowed: boolean;\n min: number | null;\n max: number | null;\n}\n\n/**\n * Frame editing constraints with optional frame-type-specific sub-properties.\n */\nexport type FrameConstraints = {\n selectionAllowed: PropertyState<boolean>;\n horizontalMovementAllowed: PropertyState<boolean>;\n verticalMovementAllowed: PropertyState<boolean>;\n rotationAllowed: PropertyState<boolean>;\n resizeAllowed: PropertyState<boolean>;\n proportionLocked: PropertyState<boolean>;\n /** Image-specific constraints. */\n image?: ImageFrameConstraints;\n /** Text-specific constraints. */\n text?: TextFrameConstraints;\n};\n\n/**\n * Image-specific constraints delta update.\n */\nexport interface ImageFrameConstraintsDeltaUpdate {\n cropAllowed?: {\n value: boolean;\n };\n}\n\n/**\n * Text-specific constraints delta update.\n */\nexport interface TextFrameConstraintsDeltaUpdate {\n editingAllowed?: {\n value: boolean;\n };\n paragraphStyles?: {\n value: IdSetManagedConstraint;\n };\n characterStyles?: {\n value: IdSetManagedConstraint;\n };\n colors?: {\n value: IdSetManagedConstraint;\n };\n fontSizes?: {\n value: FontSizeRangeManagedConstraint;\n };\n}\n\n/**\n * Frame constraints delta update with optional frame-type-specific sub-properties.\n */\nexport interface FrameConstraintsDeltaUpdate {\n selectionAllowed?: {\n value: boolean;\n };\n horizontalMovementAllowed?: {\n value: boolean;\n };\n verticalMovementAllowed?: {\n value: boolean;\n };\n rotationAllowed?: {\n value: boolean;\n };\n resizeAllowed?: {\n value: boolean;\n };\n proportionLocked?: {\n value: boolean;\n };\n /** Image-specific constraints update. */\n image?: ImageFrameConstraintsDeltaUpdate;\n /** Text-specific constraints update. */\n text?: TextFrameConstraintsDeltaUpdate;\n}\n\nexport type SmartCropSettings = SmartCropSettingsV1 | SmartCropSettingsV2;\n\nexport type SmartCropSettingsV1 = {\n version: SmartCropVersion.v1;\n};\n\nexport type SmartCropSettingsV2 = {\n version: SmartCropVersion.v2;\n horizontalBias: SmartCropAxisBias;\n verticalBias: SmartCropAxisBias;\n};\n\nexport enum SmartCropVersion {\n v1 = 'v1',\n v2 = 'v2',\n}\n\n/**\n * Latest version of the smart crop algorithm.\n * Keep in sync with @SmartCropVersion enum.\n */\nexport const LATEST_SMART_CROP_VERSION = SmartCropVersion.v2;\n\nexport enum SmartCropAxisBias {\n start = 'start',\n center = 'center',\n end = 'end',\n}\n"],"names":["ComponentFitEnum","AutoGrowDirection","ImageSourceTypeEnum","ComponentSourceTypeEnum","FrameTypeEnum","BarcodeSourceTypeEnum","TextDirection","FlowDirection","VerticalAlign","BlendMode","FitMode","FitModePosition","UpdateZIndexMethod","FrameAnchorType","AnchorTargetType","AnchorTargetEdgeType","CropType","SmartCropVersion","SmartCropAxisBias"],"mappings":";;AAqOO,IAAK,qCAAAA,sBAAL;AAIHA,oBAAA,QAAA,IAAS;AAKTA,oBAAA,OAAA,IAAQ;AAMRA,oBAAA,gBAAA,IAAiB;AAfT,SAAAA;AAAA,GAAA,oBAAA,CAAA,CAAA;AAuFL,IAAK,sCAAAC,uBAAL;AACHA,qBAAA,KAAA,IAAM;AACNA,qBAAA,QAAA,IAAS;AACTA,qBAAA,MAAA,IAAO;AACPA,qBAAA,OAAA,IAAQ;AAJA,SAAAA;AAAA,GAAA,qBAAA,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,IAAQ;AAFA,SAAAA;AAAA,GAAA,oBAAA,CAAA,CAAA;AAKL,IAAK,yCAAAC,0BAAL;AACHA,wBAAA,OAAA,IAAQ;AACRA,wBAAA,KAAA,IAAM;AACNA,wBAAA,QAAA,IAAS;AAHD,SAAAA;AAAA,GAAA,wBAAA,CAAA,CAAA;AAML,MAAM,iBAAiB;AAAA,EAAvB,cAAA;AACH,SAAA,OAAO;AAAA,EAAA;AACX;AAEO,MAAM,kBAAkB;AAAA,EAK3B,YAAY,IAAQ,MAA4B;AAFhD,SAAA,OAAO;AAID,SAAK,UAAU,IAAM,KAAK,OAAO;AAAA,EACvC;AACJ;AAyDO,IAAK,6BAAAC,cAAL;AACHA,YAAA,WAAA,IAAY;AACZA,YAAA,WAAA,IAAY;AAFJ,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;AA0IL,IAAK,qCAAAC,sBAAL;AACHA,oBAAA,IAAA,IAAK;AACLA,oBAAA,IAAA,IAAK;AAFG,SAAAA;AAAA,GAAA,oBAAA,CAAA,CAAA;AASL,MAAM,4BAA4B;AAElC,IAAK,sCAAAC,uBAAL;AACHA,qBAAA,OAAA,IAAQ;AACRA,qBAAA,QAAA,IAAS;AACTA,qBAAA,KAAA,IAAM;AAHE,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -85,6 +85,8 @@ export type ShapeFrame = {
|
|
|
85
85
|
strokeWeight: number;
|
|
86
86
|
strokeColor: ColorUsage;
|
|
87
87
|
allCornersSame: boolean;
|
|
88
|
+
fillOverprint: boolean;
|
|
89
|
+
strokeOverprint: boolean;
|
|
88
90
|
};
|
|
89
91
|
src: {
|
|
90
92
|
type: ShapeType;
|
|
@@ -124,6 +126,7 @@ export type BarcodeFrame = {
|
|
|
124
126
|
type: FrameTypeEnum.barcode;
|
|
125
127
|
blendMode: BlendMode;
|
|
126
128
|
barcodeProperties: {
|
|
129
|
+
enableBars: boolean;
|
|
127
130
|
enableBackground: boolean;
|
|
128
131
|
backgroundColor: ColorUsage;
|
|
129
132
|
enableBarColor: boolean;
|
|
@@ -135,6 +138,8 @@ export type BarcodeFrame = {
|
|
|
135
138
|
errorCorrectionLevel?: BarcodeErrorCorrectionLevel;
|
|
136
139
|
characterSet?: BarcodeCharacterSet;
|
|
137
140
|
drawStartStopChars: boolean;
|
|
141
|
+
barcodeOverprint: boolean;
|
|
142
|
+
backgroundOverprint: boolean;
|
|
138
143
|
};
|
|
139
144
|
src?: BarcodeSource;
|
|
140
145
|
barcodeType: BarcodeType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrameTypes.es.js","sources":["../../../src/types/FrameTypes.ts"],"sourcesContent":["// FramePropertiesDto\nimport { BarcodeCharacterSet, BarcodeErrorCorrectionLevel, BarcodeType, QuietZone } from './BarcodeTypes';\nimport { ColorUsage } from './ColorStyleTypes';\nimport { HasOverrideState, Id, PropertyState } from './CommonTypes';\nimport { GradientUsage } from './GradientStyleTypes';\nimport { ComponentGridSettings } from '../types/ComponentGridTypes';\nimport {\n CornerRadiusAll,\n CornerRadiusNone,\n CornerRadiusOnly,\n ShapeFrameSource,\n ShapeType,\n ShapeContainerProperties,\n} from './ShapeTypes';\n\nexport type FrameLayoutType = {\n id: Id;\n layoutId: Id;\n horizontal: FrameAnchor;\n vertical: FrameAnchor;\n x: PropertyState<number>;\n y: PropertyState<number>;\n width: PropertyState<number>;\n height: PropertyState<number>;\n rotationDegrees: PropertyState<number>;\n scaleX: PropertyState<number>;\n scaleY: PropertyState<number>;\n isVisible: PropertyState<boolean>;\n fitMode: PropertyState<FitMode>;\n fitModePosition: PropertyState<FitModePosition>;\n smartCropSettings: PropertyState<SmartCropSettings>;\n hasImageCrop: PropertyState<boolean>;\n hasFrameSubjectArea: PropertyState<boolean>;\n minCopyfitting: PropertyState<number>;\n maxCopyfitting: PropertyState<number>;\n enableCopyfitting: PropertyState<boolean>;\n autoGrow: AutoGrowSettings;\n isShowingCustomCroppedAsset: boolean;\n customCroppedAssetCount: number;\n subjectId: PropertyState<Id | null>;\n componentGridSettings: PropertyState<ComponentGridSettings>;\n componentFit: PropertyState<ComponentFitEnum>;\n} | null;\n\n//Frame.image\nexport type FrameType = {\n id: Id;\n name: string;\n type: FrameTypeEnum;\n // `imageUrl` is not generic: should be removed from model\n imageUrl: string;\n blendMode: string;\n opacity: number;\n};\n\nexport type Frame = TextFrame | ImageFrame | ShapeFrame | BarcodeFrame | ComponentFrame | ComponentGridFrame;\n\nexport type ImageFrameVariableSource = {\n type: ImageSourceTypeEnum.variable;\n id: Id;\n};\n\nexport type ImageFrameUrlSource = {\n type: ImageSourceTypeEnum.url;\n url: string;\n};\n\nexport type ImageFrameConnectorSource = {\n type: ImageSourceTypeEnum.connector;\n assetId: Id;\n id: Id;\n};\n\nexport type ImageFrameBrandkitMediaSource = {\n type: ImageSourceTypeEnum.brandKitMedia;\n name: string;\n};\n\nexport type ImageFrameSource =\n | ImageFrameConnectorSource\n | ImageFrameVariableSource\n | ImageFrameUrlSource\n | ImageFrameBrandkitMediaSource;\n\n// used by new getter methods\nexport type ImageFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.image;\n src?: ImageFrameSource;\n blendMode: BlendMode;\n dropShadowSettings?: DropShadowSettings;\n container: {\n source: ShapeFrameSource;\n properties: ShapeContainerProperties;\n };\n};\n\nexport type ShapeFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.shape;\n blendMode: BlendMode;\n shapeProperties: {\n enableFill: boolean;\n fillColor: ColorUsage;\n enableStroke: boolean;\n strokeWeight: number;\n strokeColor: ColorUsage;\n allCornersSame: boolean;\n };\n src: {\n type: ShapeType;\n cornerRadius: CornerRadiusNone | CornerRadiusAll | CornerRadiusOnly;\n sides?: number;\n };\n dropShadowSettings?: DropShadowSettings;\n gradient?: GradientUsage;\n};\n\nexport type TextFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.text;\n textContent: string;\n paddingLeft: number;\n paddingTop: number;\n paddingRight: number;\n paddingBottom: number;\n numberOfColumns: number;\n columnGap: number;\n textDirection: TextDirection;\n flowDirection: FlowDirection;\n verticalAlign: VerticalAlign;\n textStroke: boolean;\n textStrokeWeight: number;\n textStrokeColor: number;\n hasClippingPath: boolean;\n blendMode: BlendMode;\n dropShadowSettings?: DropShadowSettings;\n hasVariable?: boolean;\n};\n\nexport type BarcodeFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.barcode;\n blendMode: BlendMode;\n barcodeProperties: {\n enableBackground: boolean;\n backgroundColor: ColorUsage;\n enableBarColor: boolean;\n barColor: ColorUsage;\n enableText: boolean;\n barHeight: number;\n magnification: number;\n quietZone: QuietZone;\n errorCorrectionLevel?: BarcodeErrorCorrectionLevel;\n characterSet?: BarcodeCharacterSet;\n drawStartStopChars: boolean;\n };\n src?: BarcodeSource;\n barcodeType: BarcodeType;\n dropShadowSettings?: DropShadowSettings;\n};\n\nexport type BarcodeSource = BarcodeVariableSource | BarcodeTextSource;\n\nexport type BarcodeVariableSource = {\n type: BarcodeSourceTypeEnum.variable;\n id: Id;\n};\n\nexport type BarcodeTextSource = {\n type: BarcodeSourceTypeEnum.text;\n text: string;\n};\n\nexport type ComponentFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.component;\n blendMode: BlendMode;\n src: ComponentSource;\n variableMappings: VariableMapping[];\n\n /**\n * @deprecated Use `componentFit` on frame properties instead. This property is deprecated and will be removed in a future version.\n * How the component fits within the frame.\n */\n fitMode: ComponentFitEnum;\n};\n\nexport type ComponentGridFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.componentGrid;\n blendMode: BlendMode;\n dataSourceVariableId?: Id | null;\n src?: ComponentSource | null;\n variableMappings: GridVariableMapping;\n};\n\nexport type GridVariableMapping = {\n mappings: Record<string, VariableMapping[] | null>;\n};\n\nexport type ComponentSource = ConnectorComponentSource;\n\nexport type ConnectorComponentSource = {\n type: ComponentSourceTypeEnum.connector;\n id: Id;\n assetId: Id | null;\n};\n\nexport type VariableMapping = {\n source: Id;\n target: Id;\n sourceField?: string;\n};\n\nexport enum ComponentFitEnum {\n /**\n * The component resizes to fit the frame size.\n */\n resize = 'resize',\n\n /**\n * The component scales to fit the frame size while maintaining its aspect ratio.\n */\n scale = 'scale',\n\n /**\n * The component first scales to fit the frame size while maintaining its aspect ratio,\n * then resizes to fill the remaining space.\n */\n scaleAndResize = 'scaleAndResize',\n}\n\nexport type CropSettings = {\n left: number;\n top: number;\n width: number;\n height: number;\n rotationDegrees: number;\n type: 'default';\n};\n\nexport type NoCropSettings = {\n type: 'noCrop';\n};\n\nexport type AutoGrowSettings = {\n enabled: PropertyState<boolean>;\n minWidth: PropertyState<number>;\n maxWidth: PropertyState<number>;\n minHeight: PropertyState<number>;\n maxHeight: PropertyState<number>;\n directions: PropertyState<Array<AutoGrowDirection>>;\n};\n\nexport interface AutoGrowDeltaUpdate {\n enabled?: {\n value: boolean;\n };\n minWidth?: {\n value: string | null;\n };\n maxWidth?: {\n value: string | null;\n };\n minHeight?: {\n value: string | null;\n };\n maxHeight?: {\n value: string | null;\n };\n directions?: {\n value: Array<AutoGrowDirection>;\n };\n}\n\nexport type DropShadowSettings = {\n enabled: boolean;\n distance: number;\n angleDegrees: number;\n blurRadius: number;\n color: ColorUsage;\n};\n\nexport interface ShadowSettingsDeltaUpdate {\n distance?: {\n value: string;\n };\n angleDegrees?: {\n value: number;\n };\n blurRadius?: {\n value: number;\n };\n enabled?: {\n value: boolean;\n };\n color?: {\n value: ColorUsage;\n };\n}\n\nexport enum AutoGrowDirection {\n top = 'top',\n bottom = 'bottom',\n left = 'left',\n right = 'right',\n}\n\nexport enum ImageSourceTypeEnum {\n url = 'url',\n variable = 'variable',\n connector = 'connector',\n brandKitMedia = 'brandKitMedia',\n}\n\nexport enum ComponentSourceTypeEnum {\n connector = 'connector',\n}\n\nexport enum FrameTypeEnum {\n text = 'text',\n image = 'image',\n shape = 'shape',\n barcode = 'barcode',\n component = 'component',\n componentGrid = 'componentGrid',\n}\n\nexport enum BarcodeSourceTypeEnum {\n variable = 'variable',\n text = 'text',\n}\n\nexport enum TextDirection {\n leftToRight = 'leftToRight',\n rightToLeft = 'rightToLeft',\n weak = 'weak',\n}\n\nexport enum FlowDirection {\n horizontal = 'horizontal',\n vertical = 'vertical',\n onPath = 'onPath',\n}\n\nexport enum VerticalAlign {\n top = 'top',\n bottom = 'bottom',\n middle = 'middle',\n justify = 'justify',\n}\n\nexport enum BlendMode {\n normal = 'normal',\n screen = 'screen',\n overlay = 'overlay',\n darken = 'darken',\n lighten = 'lighten',\n colorDodge = 'colorDodge',\n colorBurn = 'colorBurn',\n hardLight = 'hardLight',\n softLight = 'softLight',\n difference = 'difference',\n exclusion = 'exclusion',\n multiply = 'multiply',\n hue = 'hue',\n saturation = 'saturation',\n color = 'color',\n luminosity = 'luminosity',\n}\n\nexport enum FitMode {\n fill = 'fill',\n fit = 'fit',\n smartCrop = 'smartCrop',\n manualCrop = 'manualCrop',\n}\n\nexport enum FitModePosition {\n topLeft = 'topLeft',\n topCenter = 'topCenter',\n topRight = 'topRight',\n centerLeft = 'centerLeft',\n center = 'center',\n centerRight = 'centerRight',\n bottomLeft = 'bottomLeft',\n bottomCenter = 'bottomCenter',\n bottomRight = 'bottomRight',\n}\n\nexport enum UpdateZIndexMethod {\n bringToFront = 'bringToFront',\n sendToBack = 'sendToBack',\n bringForward = 'bringForward',\n sendBackward = 'sendBackward',\n}\n\nexport enum FrameAnchorType {\n relative = 'relative',\n start = 'start',\n end = 'end',\n startAndEnd = 'startAndEnd',\n center = 'center',\n}\n\nexport enum AnchorTargetType {\n page = 'page',\n frame = 'frame',\n}\n\nexport enum AnchorTargetEdgeType {\n start = 'start',\n end = 'end',\n center = 'center',\n}\n\nexport class PageAnchorTarget {\n type = AnchorTargetType.page;\n}\n\nexport class FrameAnchorTarget {\n frameId: Id;\n edge: AnchorTargetEdgeType;\n type = AnchorTargetType.frame;\n\n constructor(id: Id, edge: AnchorTargetEdgeType) {\n (this.frameId = id), (this.edge = edge);\n }\n}\n\nexport type AnchorTarget = PageAnchorTarget | FrameAnchorTarget;\n\nexport type RelativeFrameAnchor = {\n start: PropertyState<number>;\n end: PropertyState<number>;\n target: AnchorTarget;\n type: FrameAnchorType.relative;\n} & HasOverrideState;\n\nexport type StartFrameAnchor = {\n offset: PropertyState<number>;\n target: AnchorTarget;\n type: FrameAnchorType.start;\n} & HasOverrideState;\n\nexport type EndFrameAnchor = {\n offset: PropertyState<number>;\n target: AnchorTarget;\n type: FrameAnchorType.end;\n} & HasOverrideState;\n\nexport type StartAndEndFrameAnchor = {\n start: PropertyState<number>;\n startTarget: AnchorTarget;\n end: PropertyState<number>;\n endTarget: AnchorTarget;\n type: FrameAnchorType.startAndEnd;\n} & HasOverrideState;\n\nexport type CenterFrameAnchor = {\n offset: PropertyState<number>;\n target: AnchorTarget;\n type: FrameAnchorType.center;\n} & HasOverrideState;\n\nexport type FrameAnchor =\n | RelativeFrameAnchor\n | StartFrameAnchor\n | EndFrameAnchor\n | StartAndEndFrameAnchor\n | CenterFrameAnchor;\n\nexport type FrameAnchorProperties = {\n horizontal: boolean;\n type: FrameAnchorType;\n target: AnchorTarget;\n endTarget?: AnchorTarget | null;\n};\n\nexport type AnchorConfiguration = {\n allowedTypes: Set<FrameAnchorType>;\n allowedFrameIds: Set<Id>;\n};\n\nexport type FrameConfiguration = {\n horizontal: AnchorConfiguration;\n vertical: AnchorConfiguration;\n};\n\nexport enum CropType {\n frameCrop = 'frameCrop',\n assetCrop = 'assetCrop',\n}\n\n/**\n * Image-specific editing constraints.\n */\nexport type ImageFrameConstraints = {\n cropAllowed: PropertyState<boolean>;\n};\n\n/**\n * Text-specific editing constraints.\n */\nexport type TextFrameConstraints = {\n editingAllowed: PropertyState<boolean>;\n paragraphStyles: PropertyState<IdSetManagedConstraint>;\n characterStyles: PropertyState<IdSetManagedConstraint>;\n colors: PropertyState<IdSetManagedConstraint>;\n fontSizes: PropertyState<FontSizeRangeManagedConstraint>;\n};\n\nexport interface ManagedConstraint {\n allowed: boolean;\n}\n\n/**\n * A managed constraint represented by a set of allowed Id identifiers.\n *\n * Example: used to allow only a specific set of paragraph or character styles.\n * - `allowed`: If true, only the provided `ids` may be used.\n * - `ids`: The set of allowed Id values.\n */\nexport interface IdSetManagedConstraint extends ManagedConstraint {\n allowed: boolean;\n ids: Id[];\n}\n\n/**\n * A managed constraint that restricts allowed font sizes to a continuous range.\n *\n * - `allowed`: If true, restricts allowed font sizes to [min, max] (inclusive).\n * - `min`: The minimum allowed font size (nullable).\n * - `max`: The maximum allowed font size (nullable).\n */\nexport interface FontSizeRangeManagedConstraint extends ManagedConstraint {\n allowed: boolean;\n min: number | null;\n max: number | null;\n}\n\n/**\n * Frame editing constraints with optional frame-type-specific sub-properties.\n */\nexport type FrameConstraints = {\n selectionAllowed: PropertyState<boolean>;\n horizontalMovementAllowed: PropertyState<boolean>;\n verticalMovementAllowed: PropertyState<boolean>;\n rotationAllowed: PropertyState<boolean>;\n resizeAllowed: PropertyState<boolean>;\n proportionLocked: PropertyState<boolean>;\n /** Image-specific constraints. */\n image?: ImageFrameConstraints;\n /** Text-specific constraints. */\n text?: TextFrameConstraints;\n};\n\n/**\n * Image-specific constraints delta update.\n */\nexport interface ImageFrameConstraintsDeltaUpdate {\n cropAllowed?: {\n value: boolean;\n };\n}\n\n/**\n * Text-specific constraints delta update.\n */\nexport interface TextFrameConstraintsDeltaUpdate {\n editingAllowed?: {\n value: boolean;\n };\n paragraphStyles?: {\n value: IdSetManagedConstraint;\n };\n characterStyles?: {\n value: IdSetManagedConstraint;\n };\n colors?: {\n value: IdSetManagedConstraint;\n };\n fontSizes?: {\n value: FontSizeRangeManagedConstraint;\n };\n}\n\n/**\n * Frame constraints delta update with optional frame-type-specific sub-properties.\n */\nexport interface FrameConstraintsDeltaUpdate {\n selectionAllowed?: {\n value: boolean;\n };\n horizontalMovementAllowed?: {\n value: boolean;\n };\n verticalMovementAllowed?: {\n value: boolean;\n };\n rotationAllowed?: {\n value: boolean;\n };\n resizeAllowed?: {\n value: boolean;\n };\n proportionLocked?: {\n value: boolean;\n };\n /** Image-specific constraints update. */\n image?: ImageFrameConstraintsDeltaUpdate;\n /** Text-specific constraints update. */\n text?: TextFrameConstraintsDeltaUpdate;\n}\n\nexport type SmartCropSettings = SmartCropSettingsV1 | SmartCropSettingsV2;\n\nexport type SmartCropSettingsV1 = {\n version: SmartCropVersion.v1;\n};\n\nexport type SmartCropSettingsV2 = {\n version: SmartCropVersion.v2;\n horizontalBias: SmartCropAxisBias;\n verticalBias: SmartCropAxisBias;\n};\n\nexport enum SmartCropVersion {\n v1 = 'v1',\n v2 = 'v2',\n}\n\n/**\n * Latest version of the smart crop algorithm.\n * Keep in sync with @SmartCropVersion enum.\n */\nexport const LATEST_SMART_CROP_VERSION = SmartCropVersion.v2;\n\nexport enum SmartCropAxisBias {\n start = 'start',\n center = 'center',\n end = 'end',\n}\n"],"names":["ComponentFitEnum","AutoGrowDirection","ImageSourceTypeEnum","ComponentSourceTypeEnum","FrameTypeEnum","BarcodeSourceTypeEnum","TextDirection","FlowDirection","VerticalAlign","BlendMode","FitMode","FitModePosition","UpdateZIndexMethod","FrameAnchorType","AnchorTargetType","AnchorTargetEdgeType","CropType","SmartCropVersion","SmartCropAxisBias"],"mappings":"AAmOO,IAAK,qCAAAA,sBAAL;AAIHA,oBAAA,QAAA,IAAS;AAKTA,oBAAA,OAAA,IAAQ;AAMRA,oBAAA,gBAAA,IAAiB;AAfT,SAAAA;AAAA,GAAA,oBAAA,CAAA,CAAA;AAuFL,IAAK,sCAAAC,uBAAL;AACHA,qBAAA,KAAA,IAAM;AACNA,qBAAA,QAAA,IAAS;AACTA,qBAAA,MAAA,IAAO;AACPA,qBAAA,OAAA,IAAQ;AAJA,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;AAOL,IAAK,wCAAAC,yBAAL;AACHA,uBAAA,KAAA,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IAAK,yCAAAC,0BAAL;AACHA,wBAAA,OAAA,IAAQ;AACRA,wBAAA,KAAA,IAAM;AACNA,wBAAA,QAAA,IAAS;AAHD,SAAAA;AAAA,GAAA,wBAAA,CAAA,CAAA;AAML,MAAM,iBAAiB;AAAA,EAAvB,cAAA;AACH,SAAA,OAAO;AAAA,EAAA;AACX;AAEO,MAAM,kBAAkB;AAAA,EAK3B,YAAY,IAAQ,MAA4B;AAFhD,SAAA,OAAO;AAGF,SAAK,UAAU,IAAM,KAAK,OAAO;AAAA,EACtC;AACJ;AA6DO,IAAK,6BAAAC,cAAL;AACHA,YAAA,WAAA,IAAY;AACZA,YAAA,WAAA,IAAY;AAFJ,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;AA0IL,IAAK,qCAAAC,sBAAL;AACHA,oBAAA,IAAA,IAAK;AACLA,oBAAA,IAAA,IAAK;AAFG,SAAAA;AAAA,GAAA,oBAAA,CAAA,CAAA;AASL,MAAM,4BAA4B;AAElC,IAAK,sCAAAC,uBAAL;AACHA,qBAAA,OAAA,IAAQ;AACRA,qBAAA,QAAA,IAAS;AACTA,qBAAA,KAAA,IAAM;AAHE,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"FrameTypes.es.js","sources":["../../../src/types/FrameTypes.ts"],"sourcesContent":["// FramePropertiesDto\nimport { BarcodeCharacterSet, BarcodeErrorCorrectionLevel, BarcodeType, QuietZone } from './BarcodeTypes';\nimport { ColorUsage } from './ColorStyleTypes';\nimport { HasOverrideState, Id, PropertyState } from './CommonTypes';\nimport { GradientUsage } from './GradientStyleTypes';\nimport { ComponentGridSettings } from '../types/ComponentGridTypes';\nimport {\n CornerRadiusAll,\n CornerRadiusNone,\n CornerRadiusOnly,\n ShapeFrameSource,\n ShapeType,\n ShapeContainerProperties,\n} from './ShapeTypes';\n\nexport type FrameLayoutType = {\n id: Id;\n layoutId: Id;\n horizontal: FrameAnchor;\n vertical: FrameAnchor;\n x: PropertyState<number>;\n y: PropertyState<number>;\n width: PropertyState<number>;\n height: PropertyState<number>;\n rotationDegrees: PropertyState<number>;\n scaleX: PropertyState<number>;\n scaleY: PropertyState<number>;\n isVisible: PropertyState<boolean>;\n fitMode: PropertyState<FitMode>;\n fitModePosition: PropertyState<FitModePosition>;\n smartCropSettings: PropertyState<SmartCropSettings>;\n hasImageCrop: PropertyState<boolean>;\n hasFrameSubjectArea: PropertyState<boolean>;\n minCopyfitting: PropertyState<number>;\n maxCopyfitting: PropertyState<number>;\n enableCopyfitting: PropertyState<boolean>;\n autoGrow: AutoGrowSettings;\n isShowingCustomCroppedAsset: boolean;\n customCroppedAssetCount: number;\n subjectId: PropertyState<Id | null>;\n componentGridSettings: PropertyState<ComponentGridSettings>;\n componentFit: PropertyState<ComponentFitEnum>;\n} | null;\n\n//Frame.image\nexport type FrameType = {\n id: Id;\n name: string;\n type: FrameTypeEnum;\n // `imageUrl` is not generic: should be removed from model\n imageUrl: string;\n blendMode: string;\n opacity: number;\n};\n\nexport type Frame = TextFrame | ImageFrame | ShapeFrame | BarcodeFrame | ComponentFrame | ComponentGridFrame;\n\nexport type ImageFrameVariableSource = {\n type: ImageSourceTypeEnum.variable;\n id: Id;\n};\n\nexport type ImageFrameUrlSource = {\n type: ImageSourceTypeEnum.url;\n url: string;\n};\n\nexport type ImageFrameConnectorSource = {\n type: ImageSourceTypeEnum.connector;\n assetId: Id;\n id: Id;\n};\n\nexport type ImageFrameBrandkitMediaSource = {\n type: ImageSourceTypeEnum.brandKitMedia;\n name: string;\n};\n\nexport type ImageFrameSource =\n ImageFrameConnectorSource | ImageFrameVariableSource | ImageFrameUrlSource | ImageFrameBrandkitMediaSource;\n\n// used by new getter methods\nexport type ImageFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.image;\n src?: ImageFrameSource;\n blendMode: BlendMode;\n dropShadowSettings?: DropShadowSettings;\n container: {\n source: ShapeFrameSource;\n properties: ShapeContainerProperties;\n };\n};\n\nexport type ShapeFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.shape;\n blendMode: BlendMode;\n shapeProperties: {\n enableFill: boolean;\n fillColor: ColorUsage;\n enableStroke: boolean;\n strokeWeight: number;\n strokeColor: ColorUsage;\n allCornersSame: boolean;\n fillOverprint: boolean;\n strokeOverprint: boolean;\n };\n src: {\n type: ShapeType;\n cornerRadius: CornerRadiusNone | CornerRadiusAll | CornerRadiusOnly;\n sides?: number;\n };\n dropShadowSettings?: DropShadowSettings;\n gradient?: GradientUsage;\n};\n\nexport type TextFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.text;\n textContent: string;\n paddingLeft: number;\n paddingTop: number;\n paddingRight: number;\n paddingBottom: number;\n numberOfColumns: number;\n columnGap: number;\n textDirection: TextDirection;\n flowDirection: FlowDirection;\n verticalAlign: VerticalAlign;\n textStroke: boolean;\n textStrokeWeight: number;\n textStrokeColor: number;\n hasClippingPath: boolean;\n blendMode: BlendMode;\n dropShadowSettings?: DropShadowSettings;\n hasVariable?: boolean;\n};\n\nexport type BarcodeFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.barcode;\n blendMode: BlendMode;\n barcodeProperties: {\n enableBars: boolean;\n enableBackground: boolean;\n backgroundColor: ColorUsage;\n enableBarColor: boolean;\n barColor: ColorUsage;\n enableText: boolean;\n barHeight: number;\n magnification: number;\n quietZone: QuietZone;\n errorCorrectionLevel?: BarcodeErrorCorrectionLevel;\n characterSet?: BarcodeCharacterSet;\n drawStartStopChars: boolean;\n barcodeOverprint: boolean;\n backgroundOverprint: boolean;\n };\n src?: BarcodeSource;\n barcodeType: BarcodeType;\n dropShadowSettings?: DropShadowSettings;\n};\n\nexport type BarcodeSource = BarcodeVariableSource | BarcodeTextSource;\n\nexport type BarcodeVariableSource = {\n type: BarcodeSourceTypeEnum.variable;\n id: Id;\n};\n\nexport type BarcodeTextSource = {\n type: BarcodeSourceTypeEnum.text;\n text: string;\n};\n\nexport type ComponentFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.component;\n blendMode: BlendMode;\n src: ComponentSource;\n variableMappings: VariableMapping[];\n\n /**\n * @deprecated Use `componentFit` on frame properties instead. This property is deprecated and will be removed in a future version.\n * How the component fits within the frame.\n */\n fitMode: ComponentFitEnum;\n};\n\nexport type ComponentGridFrame = {\n id: Id;\n name: string;\n opacity: number;\n type: FrameTypeEnum.componentGrid;\n blendMode: BlendMode;\n dataSourceVariableId?: Id | null;\n src?: ComponentSource | null;\n variableMappings: GridVariableMapping;\n};\n\nexport type GridVariableMapping = {\n mappings: Record<string, VariableMapping[] | null>;\n};\n\nexport type ComponentSource = ConnectorComponentSource;\n\nexport type ConnectorComponentSource = {\n type: ComponentSourceTypeEnum.connector;\n id: Id;\n assetId: Id | null;\n};\n\nexport type VariableMapping = {\n source: Id;\n target: Id;\n sourceField?: string;\n};\n\nexport enum ComponentFitEnum {\n /**\n * The component resizes to fit the frame size.\n */\n resize = 'resize',\n\n /**\n * The component scales to fit the frame size while maintaining its aspect ratio.\n */\n scale = 'scale',\n\n /**\n * The component first scales to fit the frame size while maintaining its aspect ratio,\n * then resizes to fill the remaining space.\n */\n scaleAndResize = 'scaleAndResize',\n}\n\nexport type CropSettings = {\n left: number;\n top: number;\n width: number;\n height: number;\n rotationDegrees: number;\n type: 'default';\n};\n\nexport type NoCropSettings = {\n type: 'noCrop';\n};\n\nexport type AutoGrowSettings = {\n enabled: PropertyState<boolean>;\n minWidth: PropertyState<number>;\n maxWidth: PropertyState<number>;\n minHeight: PropertyState<number>;\n maxHeight: PropertyState<number>;\n directions: PropertyState<Array<AutoGrowDirection>>;\n};\n\nexport interface AutoGrowDeltaUpdate {\n enabled?: {\n value: boolean;\n };\n minWidth?: {\n value: string | null;\n };\n maxWidth?: {\n value: string | null;\n };\n minHeight?: {\n value: string | null;\n };\n maxHeight?: {\n value: string | null;\n };\n directions?: {\n value: Array<AutoGrowDirection>;\n };\n}\n\nexport type DropShadowSettings = {\n enabled: boolean;\n distance: number;\n angleDegrees: number;\n blurRadius: number;\n color: ColorUsage;\n};\n\nexport interface ShadowSettingsDeltaUpdate {\n distance?: {\n value: string;\n };\n angleDegrees?: {\n value: number;\n };\n blurRadius?: {\n value: number;\n };\n enabled?: {\n value: boolean;\n };\n color?: {\n value: ColorUsage;\n };\n}\n\nexport enum AutoGrowDirection {\n top = 'top',\n bottom = 'bottom',\n left = 'left',\n right = 'right',\n}\n\nexport enum ImageSourceTypeEnum {\n url = 'url',\n variable = 'variable',\n connector = 'connector',\n brandKitMedia = 'brandKitMedia',\n}\n\nexport enum ComponentSourceTypeEnum {\n connector = 'connector',\n}\n\nexport enum FrameTypeEnum {\n text = 'text',\n image = 'image',\n shape = 'shape',\n barcode = 'barcode',\n component = 'component',\n componentGrid = 'componentGrid',\n}\n\nexport enum BarcodeSourceTypeEnum {\n variable = 'variable',\n text = 'text',\n}\n\nexport enum TextDirection {\n leftToRight = 'leftToRight',\n rightToLeft = 'rightToLeft',\n weak = 'weak',\n}\n\nexport enum FlowDirection {\n horizontal = 'horizontal',\n vertical = 'vertical',\n onPath = 'onPath',\n}\n\nexport enum VerticalAlign {\n top = 'top',\n bottom = 'bottom',\n middle = 'middle',\n justify = 'justify',\n}\n\nexport enum BlendMode {\n normal = 'normal',\n screen = 'screen',\n overlay = 'overlay',\n darken = 'darken',\n lighten = 'lighten',\n colorDodge = 'colorDodge',\n colorBurn = 'colorBurn',\n hardLight = 'hardLight',\n softLight = 'softLight',\n difference = 'difference',\n exclusion = 'exclusion',\n multiply = 'multiply',\n hue = 'hue',\n saturation = 'saturation',\n color = 'color',\n luminosity = 'luminosity',\n}\n\nexport enum FitMode {\n fill = 'fill',\n fit = 'fit',\n smartCrop = 'smartCrop',\n manualCrop = 'manualCrop',\n}\n\nexport enum FitModePosition {\n topLeft = 'topLeft',\n topCenter = 'topCenter',\n topRight = 'topRight',\n centerLeft = 'centerLeft',\n center = 'center',\n centerRight = 'centerRight',\n bottomLeft = 'bottomLeft',\n bottomCenter = 'bottomCenter',\n bottomRight = 'bottomRight',\n}\n\nexport enum UpdateZIndexMethod {\n bringToFront = 'bringToFront',\n sendToBack = 'sendToBack',\n bringForward = 'bringForward',\n sendBackward = 'sendBackward',\n}\n\nexport enum FrameAnchorType {\n relative = 'relative',\n start = 'start',\n end = 'end',\n startAndEnd = 'startAndEnd',\n center = 'center',\n}\n\nexport enum AnchorTargetType {\n page = 'page',\n frame = 'frame',\n}\n\nexport enum AnchorTargetEdgeType {\n start = 'start',\n end = 'end',\n center = 'center',\n}\n\nexport class PageAnchorTarget {\n type = AnchorTargetType.page;\n}\n\nexport class FrameAnchorTarget {\n frameId: Id;\n edge: AnchorTargetEdgeType;\n type = AnchorTargetType.frame;\n\n constructor(id: Id, edge: AnchorTargetEdgeType) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n ((this.frameId = id), (this.edge = edge));\n }\n}\n\nexport type AnchorTarget = PageAnchorTarget | FrameAnchorTarget;\n\nexport type RelativeFrameAnchor = {\n start: PropertyState<number>;\n end: PropertyState<number>;\n target: AnchorTarget;\n type: FrameAnchorType.relative;\n} & HasOverrideState;\n\nexport type StartFrameAnchor = {\n offset: PropertyState<number>;\n target: AnchorTarget;\n type: FrameAnchorType.start;\n} & HasOverrideState;\n\nexport type EndFrameAnchor = {\n offset: PropertyState<number>;\n target: AnchorTarget;\n type: FrameAnchorType.end;\n} & HasOverrideState;\n\nexport type StartAndEndFrameAnchor = {\n start: PropertyState<number>;\n startTarget: AnchorTarget;\n end: PropertyState<number>;\n endTarget: AnchorTarget;\n type: FrameAnchorType.startAndEnd;\n} & HasOverrideState;\n\nexport type CenterFrameAnchor = {\n offset: PropertyState<number>;\n target: AnchorTarget;\n type: FrameAnchorType.center;\n} & HasOverrideState;\n\nexport type FrameAnchor =\n RelativeFrameAnchor | StartFrameAnchor | EndFrameAnchor | StartAndEndFrameAnchor | CenterFrameAnchor;\n\nexport type FrameAnchorProperties = {\n horizontal: boolean;\n type: FrameAnchorType;\n target: AnchorTarget;\n endTarget?: AnchorTarget | null;\n};\n\nexport type AnchorConfiguration = {\n allowedTypes: Set<FrameAnchorType>;\n allowedFrameIds: Set<Id>;\n};\n\nexport type FrameConfiguration = {\n horizontal: AnchorConfiguration;\n vertical: AnchorConfiguration;\n};\n\nexport enum CropType {\n frameCrop = 'frameCrop',\n assetCrop = 'assetCrop',\n}\n\n/**\n * Image-specific editing constraints.\n */\nexport type ImageFrameConstraints = {\n cropAllowed: PropertyState<boolean>;\n};\n\n/**\n * Text-specific editing constraints.\n */\nexport type TextFrameConstraints = {\n editingAllowed: PropertyState<boolean>;\n paragraphStyles: PropertyState<IdSetManagedConstraint>;\n characterStyles: PropertyState<IdSetManagedConstraint>;\n colors: PropertyState<IdSetManagedConstraint>;\n fontSizes: PropertyState<FontSizeRangeManagedConstraint>;\n};\n\nexport interface ManagedConstraint {\n allowed: boolean;\n}\n\n/**\n * A managed constraint represented by a set of allowed Id identifiers.\n *\n * Example: used to allow only a specific set of paragraph or character styles.\n * - `allowed`: If true, only the provided `ids` may be used.\n * - `ids`: The set of allowed Id values.\n */\nexport interface IdSetManagedConstraint extends ManagedConstraint {\n allowed: boolean;\n ids: Id[];\n}\n\n/**\n * A managed constraint that restricts allowed font sizes to a continuous range.\n *\n * - `allowed`: If true, restricts allowed font sizes to [min, max] (inclusive).\n * - `min`: The minimum allowed font size (nullable).\n * - `max`: The maximum allowed font size (nullable).\n */\nexport interface FontSizeRangeManagedConstraint extends ManagedConstraint {\n allowed: boolean;\n min: number | null;\n max: number | null;\n}\n\n/**\n * Frame editing constraints with optional frame-type-specific sub-properties.\n */\nexport type FrameConstraints = {\n selectionAllowed: PropertyState<boolean>;\n horizontalMovementAllowed: PropertyState<boolean>;\n verticalMovementAllowed: PropertyState<boolean>;\n rotationAllowed: PropertyState<boolean>;\n resizeAllowed: PropertyState<boolean>;\n proportionLocked: PropertyState<boolean>;\n /** Image-specific constraints. */\n image?: ImageFrameConstraints;\n /** Text-specific constraints. */\n text?: TextFrameConstraints;\n};\n\n/**\n * Image-specific constraints delta update.\n */\nexport interface ImageFrameConstraintsDeltaUpdate {\n cropAllowed?: {\n value: boolean;\n };\n}\n\n/**\n * Text-specific constraints delta update.\n */\nexport interface TextFrameConstraintsDeltaUpdate {\n editingAllowed?: {\n value: boolean;\n };\n paragraphStyles?: {\n value: IdSetManagedConstraint;\n };\n characterStyles?: {\n value: IdSetManagedConstraint;\n };\n colors?: {\n value: IdSetManagedConstraint;\n };\n fontSizes?: {\n value: FontSizeRangeManagedConstraint;\n };\n}\n\n/**\n * Frame constraints delta update with optional frame-type-specific sub-properties.\n */\nexport interface FrameConstraintsDeltaUpdate {\n selectionAllowed?: {\n value: boolean;\n };\n horizontalMovementAllowed?: {\n value: boolean;\n };\n verticalMovementAllowed?: {\n value: boolean;\n };\n rotationAllowed?: {\n value: boolean;\n };\n resizeAllowed?: {\n value: boolean;\n };\n proportionLocked?: {\n value: boolean;\n };\n /** Image-specific constraints update. */\n image?: ImageFrameConstraintsDeltaUpdate;\n /** Text-specific constraints update. */\n text?: TextFrameConstraintsDeltaUpdate;\n}\n\nexport type SmartCropSettings = SmartCropSettingsV1 | SmartCropSettingsV2;\n\nexport type SmartCropSettingsV1 = {\n version: SmartCropVersion.v1;\n};\n\nexport type SmartCropSettingsV2 = {\n version: SmartCropVersion.v2;\n horizontalBias: SmartCropAxisBias;\n verticalBias: SmartCropAxisBias;\n};\n\nexport enum SmartCropVersion {\n v1 = 'v1',\n v2 = 'v2',\n}\n\n/**\n * Latest version of the smart crop algorithm.\n * Keep in sync with @SmartCropVersion enum.\n */\nexport const LATEST_SMART_CROP_VERSION = SmartCropVersion.v2;\n\nexport enum SmartCropAxisBias {\n start = 'start',\n center = 'center',\n end = 'end',\n}\n"],"names":["ComponentFitEnum","AutoGrowDirection","ImageSourceTypeEnum","ComponentSourceTypeEnum","FrameTypeEnum","BarcodeSourceTypeEnum","TextDirection","FlowDirection","VerticalAlign","BlendMode","FitMode","FitModePosition","UpdateZIndexMethod","FrameAnchorType","AnchorTargetType","AnchorTargetEdgeType","CropType","SmartCropVersion","SmartCropAxisBias"],"mappings":"AAqOO,IAAK,qCAAAA,sBAAL;AAIHA,oBAAA,QAAA,IAAS;AAKTA,oBAAA,OAAA,IAAQ;AAMRA,oBAAA,gBAAA,IAAiB;AAfT,SAAAA;AAAA,GAAA,oBAAA,CAAA,CAAA;AAuFL,IAAK,sCAAAC,uBAAL;AACHA,qBAAA,KAAA,IAAM;AACNA,qBAAA,QAAA,IAAS;AACTA,qBAAA,MAAA,IAAO;AACPA,qBAAA,OAAA,IAAQ;AAJA,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;AAOL,IAAK,wCAAAC,yBAAL;AACHA,uBAAA,KAAA,IAAM;AACNA,uBAAA,UAAA,IAAW;AACXA,uBAAA,WAAA,IAAY;AACZA,uBAAA,eAAA,IAAgB;AAJR,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAOL,IAAK,4CAAAC,6BAAL;AACHA,2BAAA,WAAA,IAAY;AADJ,SAAAA;AAAA,GAAA,2BAAA,CAAA,CAAA;AAIL,IAAK,kCAAAC,mBAAL;AACHA,iBAAA,MAAA,IAAO;AACPA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,SAAA,IAAU;AACVA,iBAAA,WAAA,IAAY;AACZA,iBAAA,eAAA,IAAgB;AANR,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AASL,IAAK,0CAAAC,2BAAL;AACHA,yBAAA,UAAA,IAAW;AACXA,yBAAA,MAAA,IAAO;AAFC,SAAAA;AAAA,GAAA,yBAAA,CAAA,CAAA;AAKL,IAAK,kCAAAC,mBAAL;AACHA,iBAAA,aAAA,IAAc;AACdA,iBAAA,aAAA,IAAc;AACdA,iBAAA,MAAA,IAAO;AAHC,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AAML,IAAK,kCAAAC,mBAAL;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,CAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParagraphStyleTypes.cjs.js","sources":["../../../src/types/ParagraphStyleTypes.ts"],"sourcesContent":["import { ColorUsage, ColorUsageUpdate } from './ColorStyleTypes';\nimport { Id } from './CommonTypes';\nimport { Alignment, Case, Scripting } from './TextStyleTypes';\n\nexport type ParagraphStyle = {\n id: Id;\n name: string;\n fontKey: string;\n fontStyle: string;\n fontSize: number;\n typographicCase: Case;\n kerningOn: boolean;\n subSuperScript: Scripting;\n // the following properties are unit properties\n trackingLeft: number;\n trackingRight: number;\n startIndent: string;\n endIndent: string;\n spaceBefore: string;\n spaceAfter: string;\n textIndent: string;\n // end of unit properties\n alignToBaseLine: boolean;\n baselineShiftValue: string;\n lineHeight: number;\n textAlign: Alignment;\n textAlignLast: Alignment;\n
|
|
1
|
+
{"version":3,"file":"ParagraphStyleTypes.cjs.js","sources":["../../../src/types/ParagraphStyleTypes.ts"],"sourcesContent":["import { ColorUsage, ColorUsageUpdate } from './ColorStyleTypes';\nimport { Id } from './CommonTypes';\nimport { Alignment, Case, Scripting } from './TextStyleTypes';\n\nexport type ParagraphStyle = {\n id: Id;\n name: string;\n fontKey: string;\n fontStyle: string;\n fontSize: number;\n typographicCase: Case;\n kerningOn: boolean;\n subSuperScript: Scripting;\n // the following properties are unit properties\n trackingLeft: number;\n trackingRight: number;\n startIndent: string;\n endIndent: string;\n spaceBefore: string;\n spaceAfter: string;\n textIndent: string;\n // end of unit properties\n alignToBaseLine: boolean;\n baselineShiftValue: string;\n lineHeight: number;\n textAlign: Alignment;\n textAlignLast: Alignment;\n fillOverprint: boolean;\n strokeOverprint: boolean;\n color: ColorUsage;\n strokeColor: ColorUsage;\n backgroundColor: ColorUsage;\n fillColorApplied: boolean;\n strokeColorApplied: boolean;\n backgroundColorApplied?: boolean;\n strokeWidth: number;\n underline: boolean;\n lineThrough: boolean;\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n bulletListStyle: BulletListStyle;\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n numericListStyle: NumericListStyle;\n};\n\nexport type ParagraphStyleUpdate = {\n fontKey?: {\n value: string;\n };\n fontSize?: {\n value: number;\n };\n typographicCase?: {\n value: Case;\n };\n kerningOn?: {\n value: boolean;\n };\n subSuperScript?: {\n value: Scripting;\n };\n trackingLeft?: {\n value: number;\n };\n trackingRight?: {\n value: number;\n };\n textIndent?: {\n value: string;\n };\n alignToBaseLine?: {\n value: boolean;\n };\n baselineShiftValue?: {\n value: string;\n };\n lineHeight?: {\n value: number;\n };\n textAlign?: {\n value: Alignment;\n };\n textAlignLast?: {\n value: Alignment;\n };\n fillOverprint?: {\n value: boolean;\n };\n strokeOverprint?: {\n value: boolean;\n };\n color?: {\n value: ColorUsageUpdate;\n };\n fillColorApplied?: {\n value: boolean;\n };\n strokeColor?: {\n value: ColorUsageUpdate;\n };\n strokeColorApplied?: {\n value: boolean;\n };\n strokeWidth?: {\n value: string;\n };\n backgroundColor?: {\n value: ColorUsageUpdate;\n };\n backgroundColorApplied?: {\n value: boolean;\n };\n underline?: {\n value: boolean;\n };\n lineThrough?: {\n value: boolean;\n };\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n bulletListBulletMarks?: {\n value: string[];\n };\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n bulletListLeftIndent?: {\n value: string;\n };\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n bulletListTextIndent?: {\n value: string;\n };\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n bulletListCharacterStyleId?: {\n value?: string;\n };\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n numericListNumberingStyle?: {\n value: NumericListNumberingStyle[];\n };\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n numericListLeftIndent?: {\n value: string;\n };\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n numericListTextIndent?: {\n value: string;\n };\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n numericListCharacterStyleId?: {\n value?: string;\n };\n};\n\nexport type BulletListStyle = {\n /**\n * Array of bullet marks for each level\n * The position of the item in the array is the level of the bullet list\n * The value of the item is the bullet mark\n */\n bulletMarks: string[];\n leftIndent: number;\n textIndent: number;\n characterStyleId?: string;\n};\n\nexport type NumericListStyle = {\n leftIndent: number;\n textIndent: number;\n numberingStyle: NumericListNumberingStyle[];\n characterStyleId?: string;\n};\n\nexport type NumericListNumberingStyle = {\n format: NumberListFormat;\n symbol: NumberListSeparatorSymbol;\n};\n\nexport enum NumberListFormat {\n arabic = 'arabic',\n romanUpperCase = 'romanUpperCase',\n romanLowerCase = 'romanLowerCase',\n latinUpperCase = 'latinUpperCase',\n latinLowerCase = 'latinLowerCase',\n}\n\nexport enum NumberListSeparatorSymbol {\n none = 'none',\n dash = 'dash',\n dot = 'dot',\n colon = 'colon',\n roundBracket = 'roundBracket',\n}\n"],"names":["NumberListFormat","NumberListSeparatorSymbol"],"mappings":";;AAmMO,IAAK,qCAAAA,sBAAL;AACHA,oBAAA,QAAA,IAAS;AACTA,oBAAA,gBAAA,IAAiB;AACjBA,oBAAA,gBAAA,IAAiB;AACjBA,oBAAA,gBAAA,IAAiB;AACjBA,oBAAA,gBAAA,IAAiB;AALT,SAAAA;AAAA,GAAA,oBAAA,CAAA,CAAA;AAQL,IAAK,8CAAAC,+BAAL;AACHA,6BAAA,MAAA,IAAO;AACPA,6BAAA,MAAA,IAAO;AACPA,6BAAA,KAAA,IAAM;AACNA,6BAAA,OAAA,IAAQ;AACRA,6BAAA,cAAA,IAAe;AALP,SAAAA;AAAA,GAAA,6BAAA,CAAA,CAAA;;;"}
|
|
@@ -22,7 +22,8 @@ export type ParagraphStyle = {
|
|
|
22
22
|
lineHeight: number;
|
|
23
23
|
textAlign: Alignment;
|
|
24
24
|
textAlignLast: Alignment;
|
|
25
|
-
|
|
25
|
+
fillOverprint: boolean;
|
|
26
|
+
strokeOverprint: boolean;
|
|
26
27
|
color: ColorUsage;
|
|
27
28
|
strokeColor: ColorUsage;
|
|
28
29
|
backgroundColor: ColorUsage;
|
|
@@ -81,7 +82,10 @@ export type ParagraphStyleUpdate = {
|
|
|
81
82
|
textAlignLast?: {
|
|
82
83
|
value: Alignment;
|
|
83
84
|
};
|
|
84
|
-
|
|
85
|
+
fillOverprint?: {
|
|
86
|
+
value: boolean;
|
|
87
|
+
};
|
|
88
|
+
strokeOverprint?: {
|
|
85
89
|
value: boolean;
|
|
86
90
|
};
|
|
87
91
|
color?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParagraphStyleTypes.es.js","sources":["../../../src/types/ParagraphStyleTypes.ts"],"sourcesContent":["import { ColorUsage, ColorUsageUpdate } from './ColorStyleTypes';\nimport { Id } from './CommonTypes';\nimport { Alignment, Case, Scripting } from './TextStyleTypes';\n\nexport type ParagraphStyle = {\n id: Id;\n name: string;\n fontKey: string;\n fontStyle: string;\n fontSize: number;\n typographicCase: Case;\n kerningOn: boolean;\n subSuperScript: Scripting;\n // the following properties are unit properties\n trackingLeft: number;\n trackingRight: number;\n startIndent: string;\n endIndent: string;\n spaceBefore: string;\n spaceAfter: string;\n textIndent: string;\n // end of unit properties\n alignToBaseLine: boolean;\n baselineShiftValue: string;\n lineHeight: number;\n textAlign: Alignment;\n textAlignLast: Alignment;\n
|
|
1
|
+
{"version":3,"file":"ParagraphStyleTypes.es.js","sources":["../../../src/types/ParagraphStyleTypes.ts"],"sourcesContent":["import { ColorUsage, ColorUsageUpdate } from './ColorStyleTypes';\nimport { Id } from './CommonTypes';\nimport { Alignment, Case, Scripting } from './TextStyleTypes';\n\nexport type ParagraphStyle = {\n id: Id;\n name: string;\n fontKey: string;\n fontStyle: string;\n fontSize: number;\n typographicCase: Case;\n kerningOn: boolean;\n subSuperScript: Scripting;\n // the following properties are unit properties\n trackingLeft: number;\n trackingRight: number;\n startIndent: string;\n endIndent: string;\n spaceBefore: string;\n spaceAfter: string;\n textIndent: string;\n // end of unit properties\n alignToBaseLine: boolean;\n baselineShiftValue: string;\n lineHeight: number;\n textAlign: Alignment;\n textAlignLast: Alignment;\n fillOverprint: boolean;\n strokeOverprint: boolean;\n color: ColorUsage;\n strokeColor: ColorUsage;\n backgroundColor: ColorUsage;\n fillColorApplied: boolean;\n strokeColorApplied: boolean;\n backgroundColorApplied?: boolean;\n strokeWidth: number;\n underline: boolean;\n lineThrough: boolean;\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n bulletListStyle: BulletListStyle;\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n numericListStyle: NumericListStyle;\n};\n\nexport type ParagraphStyleUpdate = {\n fontKey?: {\n value: string;\n };\n fontSize?: {\n value: number;\n };\n typographicCase?: {\n value: Case;\n };\n kerningOn?: {\n value: boolean;\n };\n subSuperScript?: {\n value: Scripting;\n };\n trackingLeft?: {\n value: number;\n };\n trackingRight?: {\n value: number;\n };\n textIndent?: {\n value: string;\n };\n alignToBaseLine?: {\n value: boolean;\n };\n baselineShiftValue?: {\n value: string;\n };\n lineHeight?: {\n value: number;\n };\n textAlign?: {\n value: Alignment;\n };\n textAlignLast?: {\n value: Alignment;\n };\n fillOverprint?: {\n value: boolean;\n };\n strokeOverprint?: {\n value: boolean;\n };\n color?: {\n value: ColorUsageUpdate;\n };\n fillColorApplied?: {\n value: boolean;\n };\n strokeColor?: {\n value: ColorUsageUpdate;\n };\n strokeColorApplied?: {\n value: boolean;\n };\n strokeWidth?: {\n value: string;\n };\n backgroundColor?: {\n value: ColorUsageUpdate;\n };\n backgroundColorApplied?: {\n value: boolean;\n };\n underline?: {\n value: boolean;\n };\n lineThrough?: {\n value: boolean;\n };\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n bulletListBulletMarks?: {\n value: string[];\n };\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n bulletListLeftIndent?: {\n value: string;\n };\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n bulletListTextIndent?: {\n value: string;\n };\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n bulletListCharacterStyleId?: {\n value?: string;\n };\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n numericListNumberingStyle?: {\n value: NumericListNumberingStyle[];\n };\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n numericListLeftIndent?: {\n value: string;\n };\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n numericListTextIndent?: {\n value: string;\n };\n /**\n * @experimental This property is experimental and may be changed in the future.\n */\n numericListCharacterStyleId?: {\n value?: string;\n };\n};\n\nexport type BulletListStyle = {\n /**\n * Array of bullet marks for each level\n * The position of the item in the array is the level of the bullet list\n * The value of the item is the bullet mark\n */\n bulletMarks: string[];\n leftIndent: number;\n textIndent: number;\n characterStyleId?: string;\n};\n\nexport type NumericListStyle = {\n leftIndent: number;\n textIndent: number;\n numberingStyle: NumericListNumberingStyle[];\n characterStyleId?: string;\n};\n\nexport type NumericListNumberingStyle = {\n format: NumberListFormat;\n symbol: NumberListSeparatorSymbol;\n};\n\nexport enum NumberListFormat {\n arabic = 'arabic',\n romanUpperCase = 'romanUpperCase',\n romanLowerCase = 'romanLowerCase',\n latinUpperCase = 'latinUpperCase',\n latinLowerCase = 'latinLowerCase',\n}\n\nexport enum NumberListSeparatorSymbol {\n none = 'none',\n dash = 'dash',\n dot = 'dot',\n colon = 'colon',\n roundBracket = 'roundBracket',\n}\n"],"names":["NumberListFormat","NumberListSeparatorSymbol"],"mappings":"AAmMO,IAAK,qCAAAA,sBAAL;AACHA,oBAAA,QAAA,IAAS;AACTA,oBAAA,gBAAA,IAAiB;AACjBA,oBAAA,gBAAA,IAAiB;AACjBA,oBAAA,gBAAA,IAAiB;AACjBA,oBAAA,gBAAA,IAAiB;AALT,SAAAA;AAAA,GAAA,oBAAA,CAAA,CAAA;AAQL,IAAK,8CAAAC,+BAAL;AACHA,6BAAA,MAAA,IAAO;AACPA,6BAAA,MAAA,IAAO;AACPA,6BAAA,KAAA,IAAM;AACNA,6BAAA,OAAA,IAAQ;AACRA,6BAAA,cAAA,IAAe;AALP,SAAAA;AAAA,GAAA,6BAAA,CAAA,CAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextRuleTypes.cjs.js","sources":["../../../src/types/RichTextRuleTypes.ts"],"sourcesContent":["import { Scripting } from './TextStyleTypes';\n\n/**\n * Defines a text flow and all style rules that are applied to it.\n */\nexport interface StructuredTextTextFlowDefinition {\n id: string;\n styleRules: StructuredTextStyleRule[];\n}\n\n/**\n * Supported style kinds for structured text rules.\n */\nexport enum StructuredTextStyleKind {\n paragraph = 'paragraph',\n character = 'character',\n lineBreak = 'lineBreak',\n inlineStyle = 'inlineStyle',\n}\n\n/**\n * A style rule for rich text parsing.\n */\nexport type StructuredTextStyleRule =\n
|
|
1
|
+
{"version":3,"file":"RichTextRuleTypes.cjs.js","sources":["../../../src/types/RichTextRuleTypes.ts"],"sourcesContent":["import { Scripting } from './TextStyleTypes';\n\n/**\n * Defines a text flow and all style rules that are applied to it.\n */\nexport interface StructuredTextTextFlowDefinition {\n id: string;\n styleRules: StructuredTextStyleRule[];\n}\n\n/**\n * Supported style kinds for structured text rules.\n */\nexport enum StructuredTextStyleKind {\n paragraph = 'paragraph',\n character = 'character',\n lineBreak = 'lineBreak',\n inlineStyle = 'inlineStyle',\n}\n\n/**\n * A style rule for rich text parsing.\n */\nexport type StructuredTextStyleRule =\n ParagraphTextStyleRule | CharacterTextStyleRule | LineBreakTextStyleRule | InlineStyleTextStyleRule;\n\nexport interface ParagraphTextStyleRule {\n matcher: StructuredTextNodeMatcher;\n paragraphStyleName: string;\n styleKind: StructuredTextStyleKind.paragraph;\n}\n\nexport interface CharacterTextStyleRule {\n matcher: StructuredTextNodeMatcher;\n characterStyleName: string;\n styleKind: StructuredTextStyleKind.character;\n}\n\nexport interface LineBreakTextStyleRule {\n matcher: StructuredTextNodeMatcher;\n styleKind: StructuredTextStyleKind.lineBreak;\n}\n\n/**\n * A style rule that applies inline character styling directly to matched\n * elements without requiring a named style.\n */\nexport interface InlineStyleTextStyleRule {\n matcher: StructuredTextNodeMatcher;\n inlineStyleDefinition: StructuredTextInlineStyleDefinition;\n styleKind: StructuredTextStyleKind.inlineStyle;\n}\n\n/**\n * Defines inline character style properties applied by inline style rules.\n *\n * Every property is optional. If a property is left `undefined`, it is not\n * overridden by the rule.\n */\nexport interface StructuredTextInlineStyleDefinition {\n underline?: boolean;\n lineThrough?: boolean;\n subSuperScript?: Scripting;\n}\n\n/**\n * Matcher for structured text nodes.\n */\nexport interface StructuredTextNodeMatcher {\n tag?: string;\n attributeMatchers: StructuredTextAttributeMatcher[];\n caseSensitive: boolean;\n}\n\n/**\n * Supported operators for matching attributes.\n */\nexport enum StructuredTextAttributeMatchOperator {\n exists = 'exists',\n missing = 'missing',\n equals = 'equals',\n notEquals = 'notEquals',\n contains = 'contains',\n startsWith = 'startsWith',\n endsWith = 'endsWith',\n}\n\n/**\n * Matcher used to evaluate a node attribute.\n */\nexport type StructuredTextAttributeMatcher =\n | ExistsStructuredTextAttributeMatcher\n | MissingStructuredTextAttributeMatcher\n | EqualsStructuredTextAttributeMatcher\n | NotEqualsStructuredTextAttributeMatcher\n | ContainsStructuredTextAttributeMatcher\n | StartsWithStructuredTextAttributeMatcher\n | EndsWithStructuredTextAttributeMatcher;\n\nexport interface ExistsStructuredTextAttributeMatcher {\n name: string;\n caseSensitive: boolean;\n matchOperator: StructuredTextAttributeMatchOperator.exists;\n}\n\nexport interface MissingStructuredTextAttributeMatcher {\n name: string;\n caseSensitive: boolean;\n matchOperator: StructuredTextAttributeMatchOperator.missing;\n}\n\nexport interface EqualsStructuredTextAttributeMatcher {\n name: string;\n caseSensitive: boolean;\n value: string;\n matchOperator: StructuredTextAttributeMatchOperator.equals;\n}\n\nexport interface NotEqualsStructuredTextAttributeMatcher {\n name: string;\n caseSensitive: boolean;\n value: string;\n matchOperator: StructuredTextAttributeMatchOperator.notEquals;\n}\n\nexport interface ContainsStructuredTextAttributeMatcher {\n name: string;\n caseSensitive: boolean;\n value: string;\n matchOperator: StructuredTextAttributeMatchOperator.contains;\n}\n\nexport interface StartsWithStructuredTextAttributeMatcher {\n name: string;\n caseSensitive: boolean;\n value: string;\n matchOperator: StructuredTextAttributeMatchOperator.startsWith;\n}\n\nexport interface EndsWithStructuredTextAttributeMatcher {\n name: string;\n caseSensitive: boolean;\n value: string;\n matchOperator: StructuredTextAttributeMatchOperator.endsWith;\n}\n"],"names":["StructuredTextStyleKind","StructuredTextAttributeMatchOperator"],"mappings":";;AAaO,IAAK,4CAAAA,6BAAL;AACHA,2BAAA,WAAA,IAAY;AACZA,2BAAA,WAAA,IAAY;AACZA,2BAAA,WAAA,IAAY;AACZA,2BAAA,aAAA,IAAc;AAJN,SAAAA;AAAA,GAAA,2BAAA,CAAA,CAAA;AAgEL,IAAK,yDAAAC,0CAAL;AACHA,wCAAA,QAAA,IAAS;AACTA,wCAAA,SAAA,IAAU;AACVA,wCAAA,QAAA,IAAS;AACTA,wCAAA,WAAA,IAAY;AACZA,wCAAA,UAAA,IAAW;AACXA,wCAAA,YAAA,IAAa;AACbA,wCAAA,UAAA,IAAW;AAPH,SAAAA;AAAA,GAAA,wCAAA,CAAA,CAAA;;;"}
|