@silexlabs/grapesjs-advanced-selector 1.0.1
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/LICENSE +9 -0
- package/README.md +148 -0
- package/babel.config.js +3 -0
- package/dist/StylableElement.d.ts +6 -0
- package/dist/StylableElement.d.ts.map +1 -0
- package/dist/components/complex-selector.d.ts +37 -0
- package/dist/components/complex-selector.d.ts.map +1 -0
- package/dist/components/compound-selector.d.ts +37 -0
- package/dist/components/compound-selector.d.ts.map +1 -0
- package/dist/components/current-selector-display.d.ts +23 -0
- package/dist/components/current-selector-display.d.ts.map +1 -0
- package/dist/components/inline-select.d.ts +29 -0
- package/dist/components/inline-select.d.ts.map +1 -0
- package/dist/components/resize-input.d.ts +5 -0
- package/dist/components/resize-input.d.ts.map +1 -0
- package/dist/components/simple-selector.d.ts +44 -0
- package/dist/components/simple-selector.d.ts.map +1 -0
- package/dist/i18n/en.d.ts +75 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/fr.d.ts +75 -0
- package/dist/i18n/fr.d.ts.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +649 -0
- package/dist/index.js.map +1 -0
- package/dist/model/ComplexSelector.d.ts +34 -0
- package/dist/model/ComplexSelector.d.ts.map +1 -0
- package/dist/model/ComplexSelector.test.d.ts +2 -0
- package/dist/model/ComplexSelector.test.d.ts.map +1 -0
- package/dist/model/CompoundSelector.d.ts +25 -0
- package/dist/model/CompoundSelector.d.ts.map +1 -0
- package/dist/model/CompoundSelector.test.d.ts +2 -0
- package/dist/model/CompoundSelector.test.d.ts.map +1 -0
- package/dist/model/GrapesJsSelectors.d.ts +48 -0
- package/dist/model/GrapesJsSelectors.d.ts.map +1 -0
- package/dist/model/GrapesJsSelectors.test.d.ts +2 -0
- package/dist/model/GrapesJsSelectors.test.d.ts.map +1 -0
- package/dist/model/Operator.d.ts +28 -0
- package/dist/model/Operator.d.ts.map +1 -0
- package/dist/model/Operator.test.d.ts +2 -0
- package/dist/model/Operator.test.d.ts.map +1 -0
- package/dist/model/PseudoClass.d.ts +56 -0
- package/dist/model/PseudoClass.d.ts.map +1 -0
- package/dist/model/PseudoClass.test.d.ts +2 -0
- package/dist/model/PseudoClass.test.d.ts.map +1 -0
- package/dist/model/SimpleSelector.d.ts +104 -0
- package/dist/model/SimpleSelector.d.ts.map +1 -0
- package/dist/model/SimpleSelector.test.d.ts +2 -0
- package/dist/model/SimpleSelector.test.d.ts.map +1 -0
- package/dist/plugin.d.ts +16 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/styles.d.ts +3 -0
- package/dist/styles.d.ts.map +1 -0
- package/eslint.config.mjs +20 -0
- package/jest.config.cjs +11 -0
- package/package.json +50 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CompoundSelector } from './CompoundSelector';
|
|
2
|
+
import { Operator } from './Operator';
|
|
3
|
+
export interface ComplexSelector {
|
|
4
|
+
mainSelector: CompoundSelector;
|
|
5
|
+
operator?: Operator;
|
|
6
|
+
relatedSelector?: CompoundSelector;
|
|
7
|
+
atRule?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const EMPTY_SELECTOR: ComplexSelector;
|
|
10
|
+
export declare function toString(cs: ComplexSelector): string;
|
|
11
|
+
export declare function specificity(cs: ComplexSelector): number;
|
|
12
|
+
/**
|
|
13
|
+
* Parses a CSS selector string and converts it into a ComplexSelector model
|
|
14
|
+
* @example fromString('div > .class') // { mainSelector: { selectors: [{ type: 'tag', value: 'div' }] }, operator: { isCombinator: true, value: '>' }, relatedSelector: { selectors: [{ type: 'class', value: 'class' }] } }
|
|
15
|
+
* @example fromString('.main:has(.related)') // { mainSelector: { selectors: [{ type: 'class', value: 'main' }] }, operator: { isCombinator: false, value: ':has' }, relatedSelector: { selectors: [{ type: 'class', value: 'related' }] } }
|
|
16
|
+
*/
|
|
17
|
+
export declare function fromString(selector: string, atRule: string): ComplexSelector;
|
|
18
|
+
/**
|
|
19
|
+
* Merge two ComplexSelectors into one
|
|
20
|
+
* This will add the relatedSelector of cs2 to the mainSelector of cs1, same for the relatedSelector
|
|
21
|
+
* If both selectors have an operator, the operator of cs1 will be kept
|
|
22
|
+
*/
|
|
23
|
+
export declare function merge(cs1: ComplexSelector, cs2: ComplexSelector): ComplexSelector;
|
|
24
|
+
/**
|
|
25
|
+
* Activate or deactivate the selectors of a ComplexSelector (main and related)
|
|
26
|
+
* Depending on the selectors of another ComplexSelector
|
|
27
|
+
* @example activateSelectors({ mainSelector: { selectors: [{ type: 'tag', value: 'div', active: false }, { type: 'class', value: '.test', active: true }] }, { mainSelector: { selectors: [{ type: 'tag', value: 'div', active: true }] }) // { mainSelector: { selectors: [{ type: 'tag', value: 'div', active: true }, { type: 'class', value: '.test', active: false } }
|
|
28
|
+
*/
|
|
29
|
+
export declare function activateSelectors(cs: ComplexSelector, other: ComplexSelector): ComplexSelector;
|
|
30
|
+
/**
|
|
31
|
+
* Make sure all ComplexSelectors have the same mainSelector, operator, and relatedSelector
|
|
32
|
+
*/
|
|
33
|
+
export declare function same(all: ComplexSelector[]): ComplexSelector | false;
|
|
34
|
+
//# sourceMappingURL=ComplexSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComplexSelector.d.ts","sourceRoot":"","sources":["../../src/model/ComplexSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAyJ,MAAM,oBAAoB,CAAA;AAC5M,OAAO,EAAE,QAAQ,EAAkE,MAAM,YAAY,CAAA;AAErG,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,gBAAgB,CAAA;IAC9B,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,eAAe,CAAC,EAAE,gBAAgB,CAAA;IAClC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,cAAc,EAItB,eAAe,CAAA;AAEpB,wBAAgB,QAAQ,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM,CAWpD;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM,CAYvD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,CAuC5E;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,eAAe,GAAG,eAAe,CASjF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,GAAG,eAAe,CAiB9F;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,eAAe,GAAG,KAAK,CAiBpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComplexSelector.test.d.ts","sourceRoot":"","sources":["../../src/model/ComplexSelector.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PseudoClass } from './PseudoClass';
|
|
2
|
+
import { SimpleSelector } from './SimpleSelector';
|
|
3
|
+
export type CompoundSelector = {
|
|
4
|
+
selectors: SimpleSelector[];
|
|
5
|
+
pseudoClass?: PseudoClass | null;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Get the full CSS selector string from a CompoundSelector
|
|
9
|
+
*/
|
|
10
|
+
export declare function toString(cs: CompoundSelector): string;
|
|
11
|
+
export declare function specificity(compound: CompoundSelector): number;
|
|
12
|
+
/**
|
|
13
|
+
* Parses a CSS selector string and converts it into a CompoundSelector model.
|
|
14
|
+
* @example fromString('div.class') // { selectors: [{ type: 'tag', value: 'div' }, { type: 'class', value: 'class' }] }
|
|
15
|
+
*/
|
|
16
|
+
export declare function fromString(selectorStr: string): CompoundSelector;
|
|
17
|
+
/**
|
|
18
|
+
* Merge two CompoundSelectors into one
|
|
19
|
+
*/
|
|
20
|
+
export declare function merge(cs1: CompoundSelector, cs2: CompoundSelector): CompoundSelector;
|
|
21
|
+
/**
|
|
22
|
+
* Activate or deactivate the selectors of `targetSelectors` based on `referenceSelectors`
|
|
23
|
+
*/
|
|
24
|
+
export declare function updateActivation(targetSelectors: SimpleSelector[], referenceSelectors: SimpleSelector[]): SimpleSelector[];
|
|
25
|
+
//# sourceMappingURL=CompoundSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompoundSelector.d.ts","sourceRoot":"","sources":["../../src/model/CompoundSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,cAAc,EAA8N,MAAM,kBAAkB,CAAA;AAG7Q,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,cAAc,EAAE,CAAA;IAC3B,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CACjC,CAAA;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,gBAAgB,GAAG,MAAM,CAYrD;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,gBAAgB,UAMrD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,gBAAgB,CAwDhE;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,GAAG,gBAAgB,CAapF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,eAAe,EAAE,cAAc,EAAE,EAAE,kBAAkB,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAQ1H"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompoundSelector.test.d.ts","sourceRoot":"","sources":["../../src/model/CompoundSelector.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Component, Editor } from 'grapesjs';
|
|
2
|
+
import { ComplexSelector } from './ComplexSelector';
|
|
3
|
+
import { SimpleSelector } from './SimpleSelector';
|
|
4
|
+
export declare function getTranslation(editor: Editor, key: string): string;
|
|
5
|
+
export declare function getUntranslatedKeys(): string[];
|
|
6
|
+
/**
|
|
7
|
+
* Get all selectors that match the selected component
|
|
8
|
+
*/
|
|
9
|
+
export declare function getSelectors(editor: Editor): ComplexSelector[];
|
|
10
|
+
/**
|
|
11
|
+
* Function to edit or add style based on the selector
|
|
12
|
+
*/
|
|
13
|
+
export declare function editStyle(editor: Editor, selector: string): void;
|
|
14
|
+
/**
|
|
15
|
+
* Check if all the selected components are selected by the provided selector
|
|
16
|
+
*/
|
|
17
|
+
export declare function matchSelectorAll(selector: string, components: Component[]): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Check if some of the selected components are selected by the provided selector
|
|
20
|
+
*/
|
|
21
|
+
export declare function matchSelectorSome(selector: string, components: Component[]): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Remove the style (rules) for the current selector (edited selector)
|
|
24
|
+
*/
|
|
25
|
+
export declare function clearStyle(editor: Editor): void;
|
|
26
|
+
export declare function getSelectedStyle(editor: Editor): any;
|
|
27
|
+
export declare function setSelectedStyle(editor: Editor, style: any): void;
|
|
28
|
+
export declare function renameSelector(editor: Editor, oldSelector: SimpleSelector, newSelector: SimpleSelector): void;
|
|
29
|
+
/**
|
|
30
|
+
* Store a selector in a component's attributes
|
|
31
|
+
*/
|
|
32
|
+
export declare function setComponentSelector(component: Component, selector: ComplexSelector): void;
|
|
33
|
+
export declare function getComponentSelector(component: Component): ComplexSelector;
|
|
34
|
+
/**
|
|
35
|
+
* Get the suggestions for the selected components which have the provided selector
|
|
36
|
+
* We want to suggest the main selector:
|
|
37
|
+
* - The component tag name and ID
|
|
38
|
+
* - Any classes that are in the current website (will be added to the component if selected) but no classes that are already in the component
|
|
39
|
+
*/
|
|
40
|
+
export declare function getSuggestionsMain(editor: Editor, components: Component[], selector: ComplexSelector): SimpleSelector[];
|
|
41
|
+
/**
|
|
42
|
+
* Get the suggestions for the related selectors. Depending on the operator (> => look for children, '+' => look for siblings, ' ' => look for parents):
|
|
43
|
+
* - Any classes that are in the parents/children/siblings of the selected components
|
|
44
|
+
* - Add the classes that are on each parent/child/sibling but not on the selected components
|
|
45
|
+
* - Same for IDs, tag names
|
|
46
|
+
*/
|
|
47
|
+
export declare function getSuggestionsRelated(editor: Editor, components: Component[], selector: ComplexSelector): SimpleSelector[];
|
|
48
|
+
//# sourceMappingURL=GrapesJsSelectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GrapesJsSelectors.d.ts","sourceRoot":"","sources":["../../src/model/GrapesJsSelectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAW,MAAM,EAAY,MAAM,UAAU,CAAA;AAC/D,OAAO,EAAE,eAAe,EAA8B,MAAM,mBAAmB,CAAA;AAC/E,OAAO,EAAuF,cAAc,EAAyC,MAAM,kBAAkB,CAAA;AAO7K,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAOlE;AAED,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,CAE9C;AAID;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,EAAE,CAiC9D;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAazD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAMnF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAMpF;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,QAQxC;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAGpD;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAG1D;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,QAiCtG;AAmDD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,QAmBnF;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,GAAG,eAAe,CA+B1E;AAID;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,eAAe,GAAG,cAAc,EAAE,CA2CvH;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,eAAe,GAAG,cAAc,EAAE,CAuF1H"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GrapesJsSelectors.test.d.ts","sourceRoot":"","sources":["../../src/model/GrapesJsSelectors.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CompoundSelector } from './CompoundSelector';
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview An Operator is either a combinator or a relational pseudo-class
|
|
4
|
+
*/
|
|
5
|
+
export declare enum OperatorType {
|
|
6
|
+
HAS = "has",
|
|
7
|
+
NOT = "not",
|
|
8
|
+
IS = "is",
|
|
9
|
+
WHERE = "where",
|
|
10
|
+
CHILD = ">",
|
|
11
|
+
DESCENDANT = " ",
|
|
12
|
+
ADJACENT = "+",
|
|
13
|
+
GENERAL_SIBLING = "~"
|
|
14
|
+
}
|
|
15
|
+
export interface Operator {
|
|
16
|
+
type: OperatorType;
|
|
17
|
+
hasParam: boolean;
|
|
18
|
+
sentencePre: string;
|
|
19
|
+
sentencePost?: string;
|
|
20
|
+
helpLink: string;
|
|
21
|
+
isCombinator: boolean;
|
|
22
|
+
displayName?: string;
|
|
23
|
+
stringRepresentation: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const OPERATORS: Operator[];
|
|
26
|
+
export declare function toString(op: Operator, sel?: CompoundSelector): string;
|
|
27
|
+
export declare function fromString(operatorStr: string): Operator;
|
|
28
|
+
//# sourceMappingURL=Operator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Operator.d.ts","sourceRoot":"","sources":["../../src/model/Operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAgC,MAAM,oBAAoB,CAAA;AAEnF;;GAEG;AAEH,oBAAY,YAAY;IACtB,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,EAAE,OAAO;IACT,KAAK,UAAU;IACf,KAAK,MAAM;IACX,UAAU,MAAM;IAChB,QAAQ,MAAM;IACd,eAAe,MAAM;CACtB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,YAAY,CAAA;IAClB,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,OAAO,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oBAAoB,EAAE,MAAM,CAAA;CAC7B;AAED,eAAO,MAAM,SAAS,EAAE,QAAQ,EAyE/B,CAAA;AAED,wBAAgB,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAiBrE;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,CAMxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Operator.test.d.ts","sourceRoot":"","sources":["../../src/model/Operator.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export declare enum PseudoClassType {
|
|
2
|
+
HOVER = "hover",
|
|
3
|
+
ACTIVE = "active",
|
|
4
|
+
FOCUS = "focus",
|
|
5
|
+
FOCUS_WITHIN = "focus-within",
|
|
6
|
+
FOCUS_VISIBLE = "focus-visible",
|
|
7
|
+
VISITED = "visited",
|
|
8
|
+
LINK = "link",
|
|
9
|
+
ANY_LINK = "any-link",// Deprecated, but some usage
|
|
10
|
+
FIRST_CHILD = "first-child",
|
|
11
|
+
LAST_CHILD = "last-child",
|
|
12
|
+
NTH_CHILD = "nth-child",
|
|
13
|
+
NTH_LAST_CHILD = "nth-last-child",
|
|
14
|
+
ONLY_CHILD = "only-child",
|
|
15
|
+
FIRST_OF_TYPE = "first-of-type",
|
|
16
|
+
LAST_OF_TYPE = "last-of-type",
|
|
17
|
+
NTH_OF_TYPE = "nth-of-type",
|
|
18
|
+
NTH_LAST_OF_TYPE = "nth-last-of-type",
|
|
19
|
+
ONLY_OF_TYPE = "only-of-type",
|
|
20
|
+
EMPTY = "empty",
|
|
21
|
+
ROOT = "root",
|
|
22
|
+
SCOPE = "scope",
|
|
23
|
+
TARGET = "target",
|
|
24
|
+
ENABLED = "enabled",
|
|
25
|
+
DISABLED = "disabled",
|
|
26
|
+
CHECKED = "checked",
|
|
27
|
+
INDETERMINATE = "indeterminate",
|
|
28
|
+
DEFAULT = "default",
|
|
29
|
+
VALID = "valid",
|
|
30
|
+
INVALID = "invalid",
|
|
31
|
+
IN_RANGE = "in-range",
|
|
32
|
+
OUT_OF_RANGE = "out-of-range",
|
|
33
|
+
REQUIRED = "required",
|
|
34
|
+
OPTIONAL = "optional",
|
|
35
|
+
READ_ONLY = "read-only",
|
|
36
|
+
READ_WRITE = "read-write",
|
|
37
|
+
LANG = "lang",
|
|
38
|
+
DIR = "dir"
|
|
39
|
+
}
|
|
40
|
+
export interface PseudoClass {
|
|
41
|
+
type: PseudoClassType;
|
|
42
|
+
hasParam: boolean;
|
|
43
|
+
param?: string | null;
|
|
44
|
+
sentencePre: string;
|
|
45
|
+
sentencePost?: string;
|
|
46
|
+
helpLink?: string;
|
|
47
|
+
displayName?: string;
|
|
48
|
+
}
|
|
49
|
+
export declare const PSEUDO_CLASSES: PseudoClass[];
|
|
50
|
+
export declare function toString(pseudoClass: PseudoClass): string;
|
|
51
|
+
/**
|
|
52
|
+
* @example fromString(':hover') // { type: 'hover', hasParam: false, sentencePre: 'On mouse', helpLink: 'https://developer.mozilla.org/en-US/docs/Web/CSS/:hover' }
|
|
53
|
+
* @example fromString(':nth-child(2n+1) // { type: 'nth-child', hasParam: true, param: '2n+1', sentencePre: 'When it is the', helpLink: 'https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child' }
|
|
54
|
+
*/
|
|
55
|
+
export declare function fromString(pseudoClassStr: string): PseudoClass;
|
|
56
|
+
//# sourceMappingURL=PseudoClass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PseudoClass.d.ts","sourceRoot":"","sources":["../../src/model/PseudoClass.ts"],"names":[],"mappings":"AAGA,oBAAY,eAAe;IAEzB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAG/B,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,QAAQ,aAAa,CAAE,6BAA6B;IAGpD,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,cAAc,mBAAmB;IACjC,UAAU,eAAe;IACzB,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,gBAAgB,qBAAqB;IACrC,YAAY,iBAAiB;IAG7B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;IACf,MAAM,WAAW;IAGjB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,aAAa,kBAAkB;IAC/B,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,UAAU,eAAe;IAGzB,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,eAAe,CAAA;IACrB,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAKD,eAAO,MAAM,cAAc,EAAE,WAAW,EA0CvC,CAAA;AAKD,wBAAgB,QAAQ,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAMzD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,WAAW,CAkB9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PseudoClass.test.d.ts","sourceRoot":"","sources":["../../src/model/PseudoClass.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The model types and functions for the simple selector
|
|
3
|
+
* A Simple selector is made of a list of simple selectors, e.g `div`, `.class`, `#id`, `[attr=^value]`
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The type of the simple selector
|
|
7
|
+
*/
|
|
8
|
+
export declare enum SimpleSelectorType {
|
|
9
|
+
TAG = "tag",
|
|
10
|
+
CUSTOM_TAG = "custom-tag",
|
|
11
|
+
CLASS = "class",
|
|
12
|
+
ID = "id",
|
|
13
|
+
ATTRIBUTE = "attribute",
|
|
14
|
+
UNIVERSAL = "universal",
|
|
15
|
+
UNKNOWN = "unknown"
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The type for tag selectors
|
|
19
|
+
*/
|
|
20
|
+
export type TAG = 'a' | 'abbr' | 'address' | 'area' | 'article' | 'aside' | 'audio' | 'b' | 'base' | 'bdi' | 'bdo' | 'blockquote' | 'body' | 'br' | 'button' | 'canvas' | 'caption' | 'cite' | 'code' | 'col' | 'colgroup' | 'data' | 'datalist' | 'dd' | 'del' | 'details' | 'dfn' | 'dialog' | 'div' | 'dl' | 'dt' | 'em' | 'embed' | 'fieldset' | 'figcaption' | 'figure' | 'footer' | 'form' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'head' | 'header' | 'hgroup' | 'hr' | 'html' | 'i' | 'iframe' | 'img' | 'input' | 'ins' | 'kbd' | 'label' | 'legend' | 'li' | 'link' | 'main' | 'map' | 'mark' | 'meta' | 'meter' | 'nav' | 'noscript' | 'object' | 'ol' | 'optgroup' | 'option' | 'output' | 'p' | 'param' | 'picture' | 'pre' | 'progress' | 'q' | 'rb' | 'rp' | 'rt' | 'rtc' | 'ruby' | 's' | 'samp' | 'script' | 'section' | 'select' | 'slot' | 'small' | 'source' | 'span' | 'strong' | 'style' | 'sub' | 'summary' | 'sup' | 'table' | 'tbody' | 'td' | 'template' | 'textarea' | 'tfoot' | 'th' | 'thead' | 'time' | 'title' | 'tr' | 'track' | 'u' | 'ul' | 'var' | 'video' | 'wbr';
|
|
21
|
+
/**
|
|
22
|
+
* A simple selector interface
|
|
23
|
+
* This is a virtual interface to be overridden by the specific simple selector types
|
|
24
|
+
*/
|
|
25
|
+
export interface SimpleSelector {
|
|
26
|
+
type: SimpleSelectorType;
|
|
27
|
+
active: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface SimpleSelectorSuggestion extends SimpleSelector {
|
|
30
|
+
createText?: string;
|
|
31
|
+
createValue?: string;
|
|
32
|
+
keepEditing?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface TagSelector extends SimpleSelector {
|
|
35
|
+
type: SimpleSelectorType.TAG;
|
|
36
|
+
value: TAG;
|
|
37
|
+
}
|
|
38
|
+
export interface IdSelector extends SimpleSelector {
|
|
39
|
+
type: SimpleSelectorType.ID;
|
|
40
|
+
value: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ClassSelector extends SimpleSelector {
|
|
43
|
+
type: SimpleSelectorType.CLASS;
|
|
44
|
+
value: string;
|
|
45
|
+
}
|
|
46
|
+
export declare enum AttributeOperatorType {
|
|
47
|
+
EQUALS = "=",
|
|
48
|
+
INCLUDES = "~=",
|
|
49
|
+
DASH_MATCH = "|=",
|
|
50
|
+
PREFIX_MATCH = "^=",
|
|
51
|
+
SUFFIX_MATCH = "$=",
|
|
52
|
+
SUBSTRING_MATCH = "*="
|
|
53
|
+
}
|
|
54
|
+
export interface AttributeSelector extends SimpleSelector {
|
|
55
|
+
type: SimpleSelectorType.ATTRIBUTE;
|
|
56
|
+
value: string;
|
|
57
|
+
operator?: AttributeOperatorType;
|
|
58
|
+
attributeValue?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface UniversalSelector extends SimpleSelector {
|
|
61
|
+
type: SimpleSelectorType.UNIVERSAL;
|
|
62
|
+
}
|
|
63
|
+
export interface CustomTagSelector extends SimpleSelector {
|
|
64
|
+
type: SimpleSelectorType.CUSTOM_TAG;
|
|
65
|
+
value: string;
|
|
66
|
+
}
|
|
67
|
+
export declare const ATTRIBUTES: string[];
|
|
68
|
+
export declare const ATTRIBUTE_OPERATORS: string[];
|
|
69
|
+
export declare const SELECTOR_PREFIXES: string[];
|
|
70
|
+
export declare const TAGS: TAG[];
|
|
71
|
+
export declare const ESCAPE_CHARS: string[];
|
|
72
|
+
export declare const COLOR_FOR_TYPE: {
|
|
73
|
+
tag: string;
|
|
74
|
+
"custom-tag": string;
|
|
75
|
+
class: string;
|
|
76
|
+
id: string;
|
|
77
|
+
attribute: string;
|
|
78
|
+
universal: string;
|
|
79
|
+
unknown: string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Compare two simple selectors to see if they are the same
|
|
83
|
+
*/
|
|
84
|
+
export declare function isSameSelector(a: SimpleSelector, b: SimpleSelector, ignoreActive?: boolean): boolean;
|
|
85
|
+
export declare function toString(selector: SimpleSelector): string;
|
|
86
|
+
export declare function getDisplayType(selector: SimpleSelector): string;
|
|
87
|
+
export declare function getDisplayName(selector: SimpleSelector): string;
|
|
88
|
+
export declare function getEditableName(selector: SimpleSelector): string;
|
|
89
|
+
/**
|
|
90
|
+
* Determines if the value is valid for the selector
|
|
91
|
+
* If not valid, will try to suggest a valid value
|
|
92
|
+
*/
|
|
93
|
+
export declare function validate(_value: string): string | false;
|
|
94
|
+
/**
|
|
95
|
+
* Get a list of suggestions, filtered and with creation suggestions
|
|
96
|
+
*/
|
|
97
|
+
export declare function suggest(filter: string, suggestions: SimpleSelector[]): SimpleSelectorSuggestion[];
|
|
98
|
+
export declare function getCreationSuggestions(validated: string | false): SimpleSelectorSuggestion[];
|
|
99
|
+
export declare function specificity(selector: SimpleSelector, ignoreActive?: boolean): number;
|
|
100
|
+
/**
|
|
101
|
+
* Returns a sorting priority for selectors based on CSS specificity rules.
|
|
102
|
+
*/
|
|
103
|
+
export declare function getSelectorPriority(selector: SimpleSelector): number;
|
|
104
|
+
//# sourceMappingURL=SimpleSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleSelector.d.ts","sourceRoot":"","sources":["../../src/model/SimpleSelector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;GAEG;AACH,oBAAY,kBAAkB;IAC5B,GAAG,QAAQ;IACX,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,EAAE,OAAO;IACT,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,GAAG,GAAG,MAAM,GAAG,SAAS,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[],"mappings":""}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Editor } from 'grapesjs';
|
|
2
|
+
export type AdvancedSelectorOptions = {
|
|
3
|
+
i18n: {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
};
|
|
6
|
+
helpLinks: {
|
|
7
|
+
actionBar: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
type CustomSelectorEventProps = {
|
|
11
|
+
container: HTMLElement;
|
|
12
|
+
};
|
|
13
|
+
export declare function initListeners(editor: Editor, options: AdvancedSelectorOptions): void;
|
|
14
|
+
export declare function initASM(editor: Editor, options: AdvancedSelectorOptions, props?: CustomSelectorEventProps): void;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAE,MAAM,UAAU,CAAA;AAQ5C,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE;QACJ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KACtB,CAAA;IACD,SAAS,EAAE;QACT,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;CACF,CAAA;AAED,KAAK,wBAAwB,GAAG;IAC9B,SAAS,EAAE,WAAW,CAAA;CACvB,CAAA;AASD,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,QA2B7E;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,EAAE,KAAK,CAAC,EAAE,wBAAwB,QAQzG"}
|
package/dist/styles.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,yBAQ5B,CAAA;AAED,eAAO,MAAM,eAAe,yBAM3B,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import eslint from '@eslint/js'
|
|
4
|
+
import tseslint from 'typescript-eslint'
|
|
5
|
+
|
|
6
|
+
export default tseslint.config(
|
|
7
|
+
eslint.configs.recommended,
|
|
8
|
+
...tseslint.configs.recommended,
|
|
9
|
+
{
|
|
10
|
+
rules: {
|
|
11
|
+
'indent': ['error', 2],
|
|
12
|
+
'semi': ['error', 'never'],
|
|
13
|
+
'quotes': ['error', 'single'],
|
|
14
|
+
'no-case-declarations': 'off',
|
|
15
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
16
|
+
'@typescript-eslint/no-unused-vars': ['error'],
|
|
17
|
+
'object-curly-spacing': ['error', 'always'] // Add this line
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
)
|
package/jest.config.cjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
preset: 'ts-jest',
|
|
3
|
+
testEnvironment: 'jsdom',
|
|
4
|
+
roots: ['<rootDir>/src'],
|
|
5
|
+
moduleFileExtensions: ['ts', 'js'],
|
|
6
|
+
transform: {
|
|
7
|
+
'^.+\\.ts$': 'ts-jest',
|
|
8
|
+
'^.+\\.js$': 'babel-jest',
|
|
9
|
+
},
|
|
10
|
+
testMatch: ['**/*.test.ts', '**/*.test.js'], // Matches both .test.ts and .test.js files
|
|
11
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@silexlabs/grapesjs-advanced-selector",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Grapesjs Advanced Selector",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/silexlabs/@silexlabs/grapesjs-advanced-selector.git"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"NOT_YET_postinstall": "$npm_execpath run build",
|
|
12
|
+
"start": "grapesjs-cli serve",
|
|
13
|
+
"dev": "grapesjs-cli serve & http-server -p 8081 ../../node_modules/grapesjs",
|
|
14
|
+
"build": "grapesjs-cli build --patch=false",
|
|
15
|
+
"bump": "npm version patch -m 'Bump v%s'",
|
|
16
|
+
"lint": "eslint 'src/**/*.{ts,tsx}'",
|
|
17
|
+
"lint:fix": "eslint 'src/**/*.{ts,tsx}' --fix",
|
|
18
|
+
"test": "jest",
|
|
19
|
+
"test:watch": "jest --watchAll",
|
|
20
|
+
"prepare": "husky"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"grapesjs",
|
|
24
|
+
"plugin"
|
|
25
|
+
],
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@babel/preset-env": "^7.26.7",
|
|
28
|
+
"@eslint/js": "^9.19.0",
|
|
29
|
+
"@types/eslint__js": "^8.42.3",
|
|
30
|
+
"@types/jest": "^29.5.14",
|
|
31
|
+
"babel-jest": "^29.7.0",
|
|
32
|
+
"eslint": "^9.19.0",
|
|
33
|
+
"grapesjs": "^0.22.5",
|
|
34
|
+
"grapesjs-cli": "^4.1.3",
|
|
35
|
+
"husky": "^9.1.7",
|
|
36
|
+
"jest": "^29.7.0",
|
|
37
|
+
"ts-jest": "^29.2.5",
|
|
38
|
+
"typescript": "^5.7.3",
|
|
39
|
+
"typescript-eslint": "^8.23.0"
|
|
40
|
+
},
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"contributors": [
|
|
43
|
+
"Alex Hoyau (https://github.com/lexoyo)"
|
|
44
|
+
],
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@silexlabs/expression-input": "^0.0.27",
|
|
47
|
+
"lit": "^3.2.1",
|
|
48
|
+
"specificity": "^1.0.0"
|
|
49
|
+
}
|
|
50
|
+
}
|