| 1 |
(function() { |
| 2 |
|
| 3 |
//#region \0rolldown/runtime.js |
| 4 |
var __defProp = Object.defineProperty; |
| 5 |
var __name = (target, value) => __defProp(target, "name", { |
| 6 |
value, |
| 7 |
configurable: true |
| 8 |
}); |
| 9 |
var __exportAll = (all, no_symbols) => { |
| 10 |
let target = {}; |
| 11 |
for (var name in all) { |
| 12 |
__defProp(target, name, { |
| 13 |
get: all[name], |
| 14 |
enumerable: true |
| 15 |
}); |
| 16 |
} |
| 17 |
if (!no_symbols) { |
| 18 |
__defProp(target, Symbol.toStringTag, { value: "Module" }); |
| 19 |
} |
| 20 |
return target; |
| 21 |
}; |
| 22 |
|
| 23 |
//#endregion |
| 24 |
|
| 25 |
//#region packages/packages/libs/editor-styles/src/utils/generate-id.ts |
| 26 |
function generateId(prefix = "", existingIds = []) { |
| 27 |
let id; |
| 28 |
do |
| 29 |
id = prefix + Math.random().toString(16).slice(2, 9); |
| 30 |
while (existingIds.includes(id)); |
| 31 |
return id; |
| 32 |
} |
| 33 |
|
| 34 |
//#endregion |
| 35 |
//#region packages/packages/libs/editor-styles/src/utils/get-styles-schema.ts |
| 36 |
var getElementorConfig = () => { |
| 37 |
return window.elementor?.config ?? {}; |
| 38 |
}; |
| 39 |
var getStylesSchema = () => { |
| 40 |
return getElementorConfig()?.atomic?.styles_schema ?? {}; |
| 41 |
}; |
| 42 |
var isExistingStyleProperty = (property) => { |
| 43 |
const stylesSchema = getStylesSchema(); |
| 44 |
return Object.keys(stylesSchema).includes(property); |
| 45 |
}; |
| 46 |
|
| 47 |
//#endregion |
| 48 |
//#region packages/packages/libs/editor-styles/src/utils/get-variant-by-meta.ts |
| 49 |
function getVariantByMeta(style, meta) { |
| 50 |
return style.variants.find((variant) => { |
| 51 |
return variant.meta.breakpoint === meta.breakpoint && variant.meta.state === meta.state; |
| 52 |
}); |
| 53 |
} |
| 54 |
|
| 55 |
//#endregion |
| 56 |
//#region packages/packages/libs/editor-styles/src/utils/state-utils.ts |
| 57 |
var PSEUDO_STATES = [ |
| 58 |
"hover", |
| 59 |
"focus", |
| 60 |
"active", |
| 61 |
"focus-visible" |
| 62 |
]; |
| 63 |
var CLASS_STATES = [ |
| 64 |
"e--selected", |
| 65 |
"e--disabled", |
| 66 |
"e--playing", |
| 67 |
"e--paused" |
| 68 |
]; |
| 69 |
function getAdditionalStates(state) { |
| 70 |
if (state === "hover") return ["focus-visible"]; |
| 71 |
return []; |
| 72 |
} |
| 73 |
function getStateSelector(state) { |
| 74 |
if (isClassState(state)) return `.${state}`; |
| 75 |
if (isPseudoState(state)) return `:${state}`; |
| 76 |
return state; |
| 77 |
} |
| 78 |
function isClassState(state) { |
| 79 |
return CLASS_STATES.includes(state); |
| 80 |
} |
| 81 |
function isPseudoState(state) { |
| 82 |
return PSEUDO_STATES.includes(state); |
| 83 |
} |
| 84 |
function getSelectorWithState(baseSelector, state) { |
| 85 |
if (!state) return baseSelector; |
| 86 |
return [state, ...getAdditionalStates(state)].map((currentState) => `${baseSelector}${getStateSelector(currentState)}`).join(","); |
| 87 |
} |
| 88 |
|
| 89 |
//#endregion |
| 90 |
//#region packages/packages/libs/editor-styles/src/index.ts |
| 91 |
var src_exports = /* @__PURE__ */ __exportAll({ |
| 92 |
generateId: () => generateId, |
| 93 |
getSelectorWithState: () => getSelectorWithState, |
| 94 |
getStylesSchema: () => getStylesSchema, |
| 95 |
getVariantByMeta: () => getVariantByMeta, |
| 96 |
isClassState: () => isClassState, |
| 97 |
isExistingStyleProperty: () => isExistingStyleProperty, |
| 98 |
isPseudoState: () => isPseudoState |
| 99 |
}); |
| 100 |
|
| 101 |
//#endregion |
| 102 |
//#region \0elementor-package-library-entry |
| 103 |
(window.elementorV2 = window.elementorV2 || {}).editorStyles = src_exports; |
| 104 |
|
| 105 |
//#endregion |
| 106 |
})(); |
| 107 |
window.elementorV2.editorStyles?.init?.(); |
| 108 |
//# sourceMappingURL=editor-styles.js.map |