@elementor/editor-styles 3.35.0-340 → 3.35.0-341

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/dist/index.d.mts CHANGED
@@ -35,6 +35,7 @@ declare function generateId(prefix?: string, existingIds?: string[]): string;
35
35
  declare const getStylesSchema: () => Record<string, _elementor_editor_props.PropType<{
36
36
  key?: string;
37
37
  }>>;
38
+ declare const isExistingStyleProperty: (property: string) => boolean;
38
39
 
39
40
  declare function getVariantByMeta(style: StyleDefinition, meta: StyleDefinitionVariant['meta']): StyleDefinitionVariant | undefined;
40
41
 
@@ -53,4 +54,4 @@ type ExtendedWindow = Window & {
53
54
  };
54
55
  };
55
56
 
56
- export { type ClassState, type CustomCss, type ExtendedWindow, type StyleDefinition, type StyleDefinitionClassState, type StyleDefinitionID, type StyleDefinitionPseudoState, type StyleDefinitionState, type StyleDefinitionType, type StyleDefinitionVariant, type StyleDefinitionsMap, generateId, getStylesSchema, getVariantByMeta, isClassState, isPseudoState };
57
+ export { type ClassState, type CustomCss, type ExtendedWindow, type StyleDefinition, type StyleDefinitionClassState, type StyleDefinitionID, type StyleDefinitionPseudoState, type StyleDefinitionState, type StyleDefinitionType, type StyleDefinitionVariant, type StyleDefinitionsMap, generateId, getStylesSchema, getVariantByMeta, isClassState, isExistingStyleProperty, isPseudoState };
package/dist/index.d.ts CHANGED
@@ -35,6 +35,7 @@ declare function generateId(prefix?: string, existingIds?: string[]): string;
35
35
  declare const getStylesSchema: () => Record<string, _elementor_editor_props.PropType<{
36
36
  key?: string;
37
37
  }>>;
38
+ declare const isExistingStyleProperty: (property: string) => boolean;
38
39
 
39
40
  declare function getVariantByMeta(style: StyleDefinition, meta: StyleDefinitionVariant['meta']): StyleDefinitionVariant | undefined;
40
41
 
@@ -53,4 +54,4 @@ type ExtendedWindow = Window & {
53
54
  };
54
55
  };
55
56
 
56
- export { type ClassState, type CustomCss, type ExtendedWindow, type StyleDefinition, type StyleDefinitionClassState, type StyleDefinitionID, type StyleDefinitionPseudoState, type StyleDefinitionState, type StyleDefinitionType, type StyleDefinitionVariant, type StyleDefinitionsMap, generateId, getStylesSchema, getVariantByMeta, isClassState, isPseudoState };
57
+ export { type ClassState, type CustomCss, type ExtendedWindow, type StyleDefinition, type StyleDefinitionClassState, type StyleDefinitionID, type StyleDefinitionPseudoState, type StyleDefinitionState, type StyleDefinitionType, type StyleDefinitionVariant, type StyleDefinitionsMap, generateId, getStylesSchema, getVariantByMeta, isClassState, isExistingStyleProperty, isPseudoState };
package/dist/index.js CHANGED
@@ -24,6 +24,7 @@ __export(index_exports, {
24
24
  getStylesSchema: () => getStylesSchema,
25
25
  getVariantByMeta: () => getVariantByMeta,
26
26
  isClassState: () => isClassState,
27
+ isExistingStyleProperty: () => isExistingStyleProperty,
27
28
  isPseudoState: () => isPseudoState
28
29
  });
29
30
  module.exports = __toCommonJS(index_exports);
@@ -47,6 +48,10 @@ var getStylesSchema = () => {
47
48
  const styleSchema = config?.atomic?.styles_schema ?? {};
48
49
  return styleSchema;
49
50
  };
51
+ var isExistingStyleProperty = (property) => {
52
+ const stylesSchema = getStylesSchema();
53
+ return Object.keys(stylesSchema).includes(property);
54
+ };
50
55
 
51
56
  // src/utils/get-variant-by-meta.ts
52
57
  function getVariantByMeta(style, meta) {
@@ -70,6 +75,7 @@ function isPseudoState(state) {
70
75
  getStylesSchema,
71
76
  getVariantByMeta,
72
77
  isClassState,
78
+ isExistingStyleProperty,
73
79
  isPseudoState
74
80
  });
75
81
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/utils/generate-id.ts","../src/utils/get-styles-schema.ts","../src/utils/get-variant-by-meta.ts","../src/utils/state-utils.ts"],"sourcesContent":["// types\nexport * from './types';\n\n// utils\nexport { generateId } from './utils/generate-id';\nexport { getStylesSchema } from './utils/get-styles-schema';\nexport { getVariantByMeta } from './utils/get-variant-by-meta';\nexport { isClassState, isPseudoState } from './utils/state-utils';\nexport { type ExtendedWindow } from './utils/types';\n","export function generateId( prefix: string = '', existingIds: string[] = [] ) {\n\tlet id: string;\n\n\tdo {\n\t\tid = prefix + Math.random().toString( 16 ).slice( 2, 9 );\n\t} while ( existingIds.includes( id ) );\n\n\treturn id;\n}\n","import { type ExtendedWindow } from './types';\n\nconst getElementorConfig = () => {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow.elementor?.config ?? {};\n};\n\nexport const getStylesSchema = () => {\n\tconst config = getElementorConfig();\n\tconst styleSchema = config?.atomic?.styles_schema ?? {};\n\n\treturn styleSchema;\n};\n","import { type StyleDefinition, type StyleDefinitionVariant } from '../types';\n\nexport function getVariantByMeta( style: StyleDefinition, meta: StyleDefinitionVariant[ 'meta' ] ) {\n\treturn style.variants.find( ( variant ) => {\n\t\treturn variant.meta.breakpoint === meta.breakpoint && variant.meta.state === meta.state;\n\t} );\n}\n","import { type StyleDefinitionClassState, type StyleDefinitionPseudoState, type StyleDefinitionState } from '../types';\n\nconst PSEUDO_STATES: StyleDefinitionPseudoState[] = [ 'hover', 'focus', 'active' ];\n\nconst CLASS_STATES: StyleDefinitionClassState[] = [ 'e--selected' ];\n\nexport function isClassState( state: StyleDefinitionState ): state is StyleDefinitionClassState {\n\treturn CLASS_STATES.includes( state as StyleDefinitionClassState );\n}\n\nexport function isPseudoState( state: StyleDefinitionState ): state is StyleDefinitionPseudoState {\n\treturn PSEUDO_STATES.includes( state as StyleDefinitionPseudoState );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,SAAS,WAAY,SAAiB,IAAI,cAAwB,CAAC,GAAI;AAC7E,MAAI;AAEJ,KAAG;AACF,SAAK,SAAS,KAAK,OAAO,EAAE,SAAU,EAAG,EAAE,MAAO,GAAG,CAAE;AAAA,EACxD,SAAU,YAAY,SAAU,EAAG;AAEnC,SAAO;AACR;;;ACNA,IAAM,qBAAqB,MAAM;AAChC,QAAM,iBAAiB;AAEvB,SAAO,eAAe,WAAW,UAAU,CAAC;AAC7C;AAEO,IAAM,kBAAkB,MAAM;AACpC,QAAM,SAAS,mBAAmB;AAClC,QAAM,cAAc,QAAQ,QAAQ,iBAAiB,CAAC;AAEtD,SAAO;AACR;;;ACXO,SAAS,iBAAkB,OAAwB,MAAyC;AAClG,SAAO,MAAM,SAAS,KAAM,CAAE,YAAa;AAC1C,WAAO,QAAQ,KAAK,eAAe,KAAK,cAAc,QAAQ,KAAK,UAAU,KAAK;AAAA,EACnF,CAAE;AACH;;;ACJA,IAAM,gBAA8C,CAAE,SAAS,SAAS,QAAS;AAEjF,IAAM,eAA4C,CAAE,aAAc;AAE3D,SAAS,aAAc,OAAkE;AAC/F,SAAO,aAAa,SAAU,KAAmC;AAClE;AAEO,SAAS,cAAe,OAAmE;AACjG,SAAO,cAAc,SAAU,KAAoC;AACpE;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/utils/generate-id.ts","../src/utils/get-styles-schema.ts","../src/utils/get-variant-by-meta.ts","../src/utils/state-utils.ts"],"sourcesContent":["// types\nexport * from './types';\n\n// utils\nexport { generateId } from './utils/generate-id';\nexport { getStylesSchema, isExistingStyleProperty } from './utils/get-styles-schema';\nexport { getVariantByMeta } from './utils/get-variant-by-meta';\nexport { isClassState, isPseudoState } from './utils/state-utils';\nexport { type ExtendedWindow } from './utils/types';\n","export function generateId( prefix: string = '', existingIds: string[] = [] ) {\n\tlet id: string;\n\n\tdo {\n\t\tid = prefix + Math.random().toString( 16 ).slice( 2, 9 );\n\t} while ( existingIds.includes( id ) );\n\n\treturn id;\n}\n","import { type ExtendedWindow } from './types';\n\nconst getElementorConfig = () => {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow.elementor?.config ?? {};\n};\n\nexport const getStylesSchema = () => {\n\tconst config = getElementorConfig();\n\tconst styleSchema = config?.atomic?.styles_schema ?? {};\n\n\treturn styleSchema;\n};\n\nexport const isExistingStyleProperty = ( property: string ): boolean => {\n\tconst stylesSchema = getStylesSchema();\n\treturn Object.keys( stylesSchema ).includes( property );\n};\n","import { type StyleDefinition, type StyleDefinitionVariant } from '../types';\n\nexport function getVariantByMeta( style: StyleDefinition, meta: StyleDefinitionVariant[ 'meta' ] ) {\n\treturn style.variants.find( ( variant ) => {\n\t\treturn variant.meta.breakpoint === meta.breakpoint && variant.meta.state === meta.state;\n\t} );\n}\n","import { type StyleDefinitionClassState, type StyleDefinitionPseudoState, type StyleDefinitionState } from '../types';\n\nconst PSEUDO_STATES: StyleDefinitionPseudoState[] = [ 'hover', 'focus', 'active' ];\n\nconst CLASS_STATES: StyleDefinitionClassState[] = [ 'e--selected' ];\n\nexport function isClassState( state: StyleDefinitionState ): state is StyleDefinitionClassState {\n\treturn CLASS_STATES.includes( state as StyleDefinitionClassState );\n}\n\nexport function isPseudoState( state: StyleDefinitionState ): state is StyleDefinitionPseudoState {\n\treturn PSEUDO_STATES.includes( state as StyleDefinitionPseudoState );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,SAAS,WAAY,SAAiB,IAAI,cAAwB,CAAC,GAAI;AAC7E,MAAI;AAEJ,KAAG;AACF,SAAK,SAAS,KAAK,OAAO,EAAE,SAAU,EAAG,EAAE,MAAO,GAAG,CAAE;AAAA,EACxD,SAAU,YAAY,SAAU,EAAG;AAEnC,SAAO;AACR;;;ACNA,IAAM,qBAAqB,MAAM;AAChC,QAAM,iBAAiB;AAEvB,SAAO,eAAe,WAAW,UAAU,CAAC;AAC7C;AAEO,IAAM,kBAAkB,MAAM;AACpC,QAAM,SAAS,mBAAmB;AAClC,QAAM,cAAc,QAAQ,QAAQ,iBAAiB,CAAC;AAEtD,SAAO;AACR;AAEO,IAAM,0BAA0B,CAAE,aAA+B;AACvE,QAAM,eAAe,gBAAgB;AACrC,SAAO,OAAO,KAAM,YAAa,EAAE,SAAU,QAAS;AACvD;;;AChBO,SAAS,iBAAkB,OAAwB,MAAyC;AAClG,SAAO,MAAM,SAAS,KAAM,CAAE,YAAa;AAC1C,WAAO,QAAQ,KAAK,eAAe,KAAK,cAAc,QAAQ,KAAK,UAAU,KAAK;AAAA,EACnF,CAAE;AACH;;;ACJA,IAAM,gBAA8C,CAAE,SAAS,SAAS,QAAS;AAEjF,IAAM,eAA4C,CAAE,aAAc;AAE3D,SAAS,aAAc,OAAkE;AAC/F,SAAO,aAAa,SAAU,KAAmC;AAClE;AAEO,SAAS,cAAe,OAAmE;AACjG,SAAO,cAAc,SAAU,KAAoC;AACpE;","names":[]}
package/dist/index.mjs CHANGED
@@ -17,6 +17,10 @@ var getStylesSchema = () => {
17
17
  const styleSchema = config?.atomic?.styles_schema ?? {};
18
18
  return styleSchema;
19
19
  };
20
+ var isExistingStyleProperty = (property) => {
21
+ const stylesSchema = getStylesSchema();
22
+ return Object.keys(stylesSchema).includes(property);
23
+ };
20
24
 
21
25
  // src/utils/get-variant-by-meta.ts
22
26
  function getVariantByMeta(style, meta) {
@@ -39,6 +43,7 @@ export {
39
43
  getStylesSchema,
40
44
  getVariantByMeta,
41
45
  isClassState,
46
+ isExistingStyleProperty,
42
47
  isPseudoState
43
48
  };
44
49
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/generate-id.ts","../src/utils/get-styles-schema.ts","../src/utils/get-variant-by-meta.ts","../src/utils/state-utils.ts"],"sourcesContent":["export function generateId( prefix: string = '', existingIds: string[] = [] ) {\n\tlet id: string;\n\n\tdo {\n\t\tid = prefix + Math.random().toString( 16 ).slice( 2, 9 );\n\t} while ( existingIds.includes( id ) );\n\n\treturn id;\n}\n","import { type ExtendedWindow } from './types';\n\nconst getElementorConfig = () => {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow.elementor?.config ?? {};\n};\n\nexport const getStylesSchema = () => {\n\tconst config = getElementorConfig();\n\tconst styleSchema = config?.atomic?.styles_schema ?? {};\n\n\treturn styleSchema;\n};\n","import { type StyleDefinition, type StyleDefinitionVariant } from '../types';\n\nexport function getVariantByMeta( style: StyleDefinition, meta: StyleDefinitionVariant[ 'meta' ] ) {\n\treturn style.variants.find( ( variant ) => {\n\t\treturn variant.meta.breakpoint === meta.breakpoint && variant.meta.state === meta.state;\n\t} );\n}\n","import { type StyleDefinitionClassState, type StyleDefinitionPseudoState, type StyleDefinitionState } from '../types';\n\nconst PSEUDO_STATES: StyleDefinitionPseudoState[] = [ 'hover', 'focus', 'active' ];\n\nconst CLASS_STATES: StyleDefinitionClassState[] = [ 'e--selected' ];\n\nexport function isClassState( state: StyleDefinitionState ): state is StyleDefinitionClassState {\n\treturn CLASS_STATES.includes( state as StyleDefinitionClassState );\n}\n\nexport function isPseudoState( state: StyleDefinitionState ): state is StyleDefinitionPseudoState {\n\treturn PSEUDO_STATES.includes( state as StyleDefinitionPseudoState );\n}\n"],"mappings":";AAAO,SAAS,WAAY,SAAiB,IAAI,cAAwB,CAAC,GAAI;AAC7E,MAAI;AAEJ,KAAG;AACF,SAAK,SAAS,KAAK,OAAO,EAAE,SAAU,EAAG,EAAE,MAAO,GAAG,CAAE;AAAA,EACxD,SAAU,YAAY,SAAU,EAAG;AAEnC,SAAO;AACR;;;ACNA,IAAM,qBAAqB,MAAM;AAChC,QAAM,iBAAiB;AAEvB,SAAO,eAAe,WAAW,UAAU,CAAC;AAC7C;AAEO,IAAM,kBAAkB,MAAM;AACpC,QAAM,SAAS,mBAAmB;AAClC,QAAM,cAAc,QAAQ,QAAQ,iBAAiB,CAAC;AAEtD,SAAO;AACR;;;ACXO,SAAS,iBAAkB,OAAwB,MAAyC;AAClG,SAAO,MAAM,SAAS,KAAM,CAAE,YAAa;AAC1C,WAAO,QAAQ,KAAK,eAAe,KAAK,cAAc,QAAQ,KAAK,UAAU,KAAK;AAAA,EACnF,CAAE;AACH;;;ACJA,IAAM,gBAA8C,CAAE,SAAS,SAAS,QAAS;AAEjF,IAAM,eAA4C,CAAE,aAAc;AAE3D,SAAS,aAAc,OAAkE;AAC/F,SAAO,aAAa,SAAU,KAAmC;AAClE;AAEO,SAAS,cAAe,OAAmE;AACjG,SAAO,cAAc,SAAU,KAAoC;AACpE;","names":[]}
1
+ {"version":3,"sources":["../src/utils/generate-id.ts","../src/utils/get-styles-schema.ts","../src/utils/get-variant-by-meta.ts","../src/utils/state-utils.ts"],"sourcesContent":["export function generateId( prefix: string = '', existingIds: string[] = [] ) {\n\tlet id: string;\n\n\tdo {\n\t\tid = prefix + Math.random().toString( 16 ).slice( 2, 9 );\n\t} while ( existingIds.includes( id ) );\n\n\treturn id;\n}\n","import { type ExtendedWindow } from './types';\n\nconst getElementorConfig = () => {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow.elementor?.config ?? {};\n};\n\nexport const getStylesSchema = () => {\n\tconst config = getElementorConfig();\n\tconst styleSchema = config?.atomic?.styles_schema ?? {};\n\n\treturn styleSchema;\n};\n\nexport const isExistingStyleProperty = ( property: string ): boolean => {\n\tconst stylesSchema = getStylesSchema();\n\treturn Object.keys( stylesSchema ).includes( property );\n};\n","import { type StyleDefinition, type StyleDefinitionVariant } from '../types';\n\nexport function getVariantByMeta( style: StyleDefinition, meta: StyleDefinitionVariant[ 'meta' ] ) {\n\treturn style.variants.find( ( variant ) => {\n\t\treturn variant.meta.breakpoint === meta.breakpoint && variant.meta.state === meta.state;\n\t} );\n}\n","import { type StyleDefinitionClassState, type StyleDefinitionPseudoState, type StyleDefinitionState } from '../types';\n\nconst PSEUDO_STATES: StyleDefinitionPseudoState[] = [ 'hover', 'focus', 'active' ];\n\nconst CLASS_STATES: StyleDefinitionClassState[] = [ 'e--selected' ];\n\nexport function isClassState( state: StyleDefinitionState ): state is StyleDefinitionClassState {\n\treturn CLASS_STATES.includes( state as StyleDefinitionClassState );\n}\n\nexport function isPseudoState( state: StyleDefinitionState ): state is StyleDefinitionPseudoState {\n\treturn PSEUDO_STATES.includes( state as StyleDefinitionPseudoState );\n}\n"],"mappings":";AAAO,SAAS,WAAY,SAAiB,IAAI,cAAwB,CAAC,GAAI;AAC7E,MAAI;AAEJ,KAAG;AACF,SAAK,SAAS,KAAK,OAAO,EAAE,SAAU,EAAG,EAAE,MAAO,GAAG,CAAE;AAAA,EACxD,SAAU,YAAY,SAAU,EAAG;AAEnC,SAAO;AACR;;;ACNA,IAAM,qBAAqB,MAAM;AAChC,QAAM,iBAAiB;AAEvB,SAAO,eAAe,WAAW,UAAU,CAAC;AAC7C;AAEO,IAAM,kBAAkB,MAAM;AACpC,QAAM,SAAS,mBAAmB;AAClC,QAAM,cAAc,QAAQ,QAAQ,iBAAiB,CAAC;AAEtD,SAAO;AACR;AAEO,IAAM,0BAA0B,CAAE,aAA+B;AACvE,QAAM,eAAe,gBAAgB;AACrC,SAAO,OAAO,KAAM,YAAa,EAAE,SAAU,QAAS;AACvD;;;AChBO,SAAS,iBAAkB,OAAwB,MAAyC;AAClG,SAAO,MAAM,SAAS,KAAM,CAAE,YAAa;AAC1C,WAAO,QAAQ,KAAK,eAAe,KAAK,cAAc,QAAQ,KAAK,UAAU,KAAK;AAAA,EACnF,CAAE;AACH;;;ACJA,IAAM,gBAA8C,CAAE,SAAS,SAAS,QAAS;AAEjF,IAAM,eAA4C,CAAE,aAAc;AAE3D,SAAS,aAAc,OAAkE;AAC/F,SAAO,aAAa,SAAU,KAAmC;AAClE;AAEO,SAAS,cAAe,OAAmE;AACjG,SAAO,cAAc,SAAU,KAAoC;AACpE;","names":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-styles",
3
3
  "description": "This package contains the styles model for the Elementor editor",
4
- "version": "3.35.0-340",
4
+ "version": "3.35.0-341",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,8 +40,8 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor-props": "3.35.0-340",
44
- "@elementor/editor-responsive": "3.35.0-340"
43
+ "@elementor/editor-props": "3.35.0-341",
44
+ "@elementor/editor-responsive": "3.35.0-341"
45
45
  },
46
46
  "devDependencies": {
47
47
  "tsup": "^8.3.5"
package/src/index.ts CHANGED
@@ -3,7 +3,7 @@ export * from './types';
3
3
 
4
4
  // utils
5
5
  export { generateId } from './utils/generate-id';
6
- export { getStylesSchema } from './utils/get-styles-schema';
6
+ export { getStylesSchema, isExistingStyleProperty } from './utils/get-styles-schema';
7
7
  export { getVariantByMeta } from './utils/get-variant-by-meta';
8
8
  export { isClassState, isPseudoState } from './utils/state-utils';
9
9
  export { type ExtendedWindow } from './utils/types';
@@ -12,3 +12,8 @@ export const getStylesSchema = () => {
12
12
 
13
13
  return styleSchema;
14
14
  };
15
+
16
+ export const isExistingStyleProperty = ( property: string ): boolean => {
17
+ const stylesSchema = getStylesSchema();
18
+ return Object.keys( stylesSchema ).includes( property );
19
+ };