@elementor/editor-styles 3.33.0-271 → 3.33.0-273
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 +17 -3
- package/dist/index.d.ts +17 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/utils/types.ts +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _elementor_editor_props from '@elementor/editor-props';
|
|
2
|
-
import { Props } from '@elementor/editor-props';
|
|
2
|
+
import { Props, PropType } from '@elementor/editor-props';
|
|
3
3
|
import { BreakpointId } from '@elementor/editor-responsive';
|
|
4
4
|
|
|
5
5
|
type ClassState = {
|
|
@@ -32,11 +32,25 @@ type StyleDefinitionsMap = Record<StyleDefinition['id'], StyleDefinition>;
|
|
|
32
32
|
|
|
33
33
|
declare function generateId(prefix?: string, existingIds?: string[]): string;
|
|
34
34
|
|
|
35
|
-
declare const getStylesSchema: () => Record<string, _elementor_editor_props.PropType
|
|
35
|
+
declare const getStylesSchema: () => Record<string, _elementor_editor_props.PropType<{
|
|
36
|
+
key?: string;
|
|
37
|
+
}>>;
|
|
36
38
|
|
|
37
39
|
declare function getVariantByMeta(style: StyleDefinition, meta: StyleDefinitionVariant['meta']): StyleDefinitionVariant | undefined;
|
|
38
40
|
|
|
39
41
|
declare function isClassState(state: StyleDefinitionState): state is StyleDefinitionClassState;
|
|
40
42
|
declare function isPseudoState(state: StyleDefinitionState): state is StyleDefinitionPseudoState;
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
type ExtendedWindow = Window & {
|
|
45
|
+
elementor: {
|
|
46
|
+
config: {
|
|
47
|
+
atomic?: {
|
|
48
|
+
styles_schema: Record<string, PropType<{
|
|
49
|
+
key?: string;
|
|
50
|
+
}>>;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _elementor_editor_props from '@elementor/editor-props';
|
|
2
|
-
import { Props } from '@elementor/editor-props';
|
|
2
|
+
import { Props, PropType } from '@elementor/editor-props';
|
|
3
3
|
import { BreakpointId } from '@elementor/editor-responsive';
|
|
4
4
|
|
|
5
5
|
type ClassState = {
|
|
@@ -32,11 +32,25 @@ type StyleDefinitionsMap = Record<StyleDefinition['id'], StyleDefinition>;
|
|
|
32
32
|
|
|
33
33
|
declare function generateId(prefix?: string, existingIds?: string[]): string;
|
|
34
34
|
|
|
35
|
-
declare const getStylesSchema: () => Record<string, _elementor_editor_props.PropType
|
|
35
|
+
declare const getStylesSchema: () => Record<string, _elementor_editor_props.PropType<{
|
|
36
|
+
key?: string;
|
|
37
|
+
}>>;
|
|
36
38
|
|
|
37
39
|
declare function getVariantByMeta(style: StyleDefinition, meta: StyleDefinitionVariant['meta']): StyleDefinitionVariant | undefined;
|
|
38
40
|
|
|
39
41
|
declare function isClassState(state: StyleDefinitionState): state is StyleDefinitionClassState;
|
|
40
42
|
declare function isPseudoState(state: StyleDefinitionState): state is StyleDefinitionPseudoState;
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
type ExtendedWindow = Window & {
|
|
45
|
+
elementor: {
|
|
46
|
+
config: {
|
|
47
|
+
atomic?: {
|
|
48
|
+
styles_schema: Record<string, PropType<{
|
|
49
|
+
key?: string;
|
|
50
|
+
}>>;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
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 };
|
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';\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 } 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":[]}
|
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.33.0-
|
|
4
|
+
"version": "3.33.0-273",
|
|
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.33.0-
|
|
44
|
-
"@elementor/editor-responsive": "3.33.0-
|
|
43
|
+
"@elementor/editor-props": "3.33.0-273",
|
|
44
|
+
"@elementor/editor-responsive": "3.33.0-273"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"tsup": "^8.3.5"
|
package/src/index.ts
CHANGED
|
@@ -6,3 +6,4 @@ export { generateId } from './utils/generate-id';
|
|
|
6
6
|
export { getStylesSchema } 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
|
+
export { type ExtendedWindow } from './utils/types';
|