@zipify/wysiwyg 1.1.1 → 1.2.1-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/.github/actions/lint-css/action.yaml +1 -3
- package/.release-it.json +2 -1
- package/dist/cli.js +3 -3
- package/dist/wysiwyg.css +24 -25
- package/dist/wysiwyg.mjs +641 -618
- package/jest.config.js +3 -0
- package/lib/components/base/Modal.vue +21 -2
- package/lib/components/base/__tests__/Modal.test.js +1 -0
- package/lib/components/toolbar/controls/link/LinkControl.vue +22 -10
- package/lib/components/toolbar/controls/link/LinkControlHeader.vue +3 -3
- package/lib/components/toolbar/controls/link/__tests__/LinkControl.test.js +8 -8
- package/lib/components/toolbar/controls/link/__tests__/LinkControlHeader.test.js +1 -1
- package/lib/components/toolbar/controls/link/composables/useLink.js +10 -6
- package/lib/composables/__tests__/__snapshots__/useEditor.test.js.snap +1 -1
- package/lib/composables/useEditor.js +4 -3
- package/lib/enums/TextSettings.js +2 -0
- package/lib/extensions/FontStyle.js +2 -2
- package/lib/extensions/FontWeight.js +2 -0
- package/lib/extensions/Link.js +13 -15
- package/lib/extensions/StylePreset.js +33 -3
- package/lib/extensions/TextDecoration.js +6 -12
- package/lib/extensions/__tests__/FontFamily.test.js +7 -6
- package/lib/extensions/__tests__/FontWeight.test.js +19 -10
- package/lib/extensions/__tests__/StylePreset.test.js +52 -2
- package/lib/extensions/__tests__/TextDecoration.test.js +11 -40
- package/lib/extensions/__tests__/__snapshots__/Alignment.test.js.snap +2 -2
- package/lib/extensions/__tests__/__snapshots__/BackgroundColor.test.js.snap +1 -1
- package/lib/extensions/__tests__/__snapshots__/FontColor.test.js.snap +1 -1
- package/lib/extensions/__tests__/__snapshots__/FontFamily.test.js.snap +19 -1
- package/lib/extensions/__tests__/__snapshots__/FontSize.test.js.snap +2 -2
- package/lib/extensions/__tests__/__snapshots__/FontStyle.test.js.snap +17 -1
- package/lib/extensions/__tests__/__snapshots__/FontWeight.test.js.snap +26 -1
- package/lib/extensions/__tests__/__snapshots__/LineHeight.test.js.snap +2 -2
- package/lib/extensions/__tests__/__snapshots__/Margin.test.js.snap +2 -2
- package/lib/extensions/__tests__/__snapshots__/StylePreset.test.js.snap +22 -2
- package/lib/extensions/__tests__/__snapshots__/TextDecoration.test.js.snap +3 -46
- package/package.json +22 -22
- package/lib/components/toolbar/controls/link/LinkControlApply.vue +0 -35
- package/node_modules_lambda/acorn-globals/node_modules/.bin/acorn +0 -4
- package/node_modules_lambda/acorn-globals/node_modules/acorn/CHANGELOG.md +0 -620
- package/node_modules_lambda/acorn-globals/node_modules/acorn/LICENSE +0 -21
- package/node_modules_lambda/acorn-globals/node_modules/acorn/README.md +0 -269
- package/node_modules_lambda/acorn-globals/node_modules/acorn/bin/acorn +0 -4
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.d.ts +0 -209
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.js +0 -5186
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.js.map +0 -1
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs +0 -5155
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs.d.ts +0 -2
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/acorn.mjs.map +0 -1
- package/node_modules_lambda/acorn-globals/node_modules/acorn/dist/bin.js +0 -64
- package/node_modules_lambda/acorn-globals/node_modules/acorn/package.json +0 -35
- package/node_modules_lambda/cssstyle/node_modules/cssom/LICENSE.txt +0 -20
- package/node_modules_lambda/cssstyle/node_modules/cssom/README.mdown +0 -67
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSDocumentRule.js +0 -39
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSFontFaceRule.js +0 -36
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSHostRule.js +0 -37
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSImportRule.js +0 -132
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSKeyframeRule.js +0 -37
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSKeyframesRule.js +0 -39
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSMediaRule.js +0 -41
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSOM.js +0 -3
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSRule.js +0 -43
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleDeclaration.js +0 -148
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleRule.js +0 -190
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSStyleSheet.js +0 -88
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSSupportsRule.js +0 -36
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSValue.js +0 -43
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/CSSValueExpression.js +0 -344
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/MatcherList.js +0 -62
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/MediaList.js +0 -61
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/StyleSheet.js +0 -17
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/clone.js +0 -82
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/index.js +0 -21
- package/node_modules_lambda/cssstyle/node_modules/cssom/lib/parse.js +0 -464
- package/node_modules_lambda/cssstyle/node_modules/cssom/package.json +0 -18
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/LICENSE.txt +0 -21
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/README.md +0 -106
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/index.js +0 -27
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/Function.js +0 -42
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URL-impl.js +0 -209
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URL.js +0 -442
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URLSearchParams-impl.js +0 -130
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/URLSearchParams.js +0 -472
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/VoidFunction.js +0 -26
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/encoding.js +0 -16
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/infra.js +0 -26
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/percent-encoding.js +0 -142
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/url-state-machine.js +0 -1244
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/urlencoded.js +0 -106
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/lib/utils.js +0 -190
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/package.json +0 -58
- package/node_modules_lambda/data-urls/node_modules/whatwg-url/webidl2js-wrapper.js +0 -7
- package/node_modules_lambda/escodegen/node_modules/estraverse/.jshintrc +0 -16
- package/node_modules_lambda/escodegen/node_modules/estraverse/LICENSE.BSD +0 -19
- package/node_modules_lambda/escodegen/node_modules/estraverse/README.md +0 -153
- package/node_modules_lambda/escodegen/node_modules/estraverse/estraverse.js +0 -805
- package/node_modules_lambda/escodegen/node_modules/estraverse/gulpfile.js +0 -70
- package/node_modules_lambda/escodegen/node_modules/estraverse/package.json +0 -40
- package/node_modules_lambda/escodegen/node_modules/levn/LICENSE +0 -22
- package/node_modules_lambda/escodegen/node_modules/levn/README.md +0 -196
- package/node_modules_lambda/escodegen/node_modules/levn/lib/cast.js +0 -298
- package/node_modules_lambda/escodegen/node_modules/levn/lib/coerce.js +0 -285
- package/node_modules_lambda/escodegen/node_modules/levn/lib/index.js +0 -22
- package/node_modules_lambda/escodegen/node_modules/levn/lib/parse-string.js +0 -113
- package/node_modules_lambda/escodegen/node_modules/levn/lib/parse.js +0 -102
- package/node_modules_lambda/escodegen/node_modules/levn/package.json +0 -47
- package/node_modules_lambda/escodegen/node_modules/optionator/CHANGELOG.md +0 -56
- package/node_modules_lambda/escodegen/node_modules/optionator/LICENSE +0 -22
- package/node_modules_lambda/escodegen/node_modules/optionator/README.md +0 -238
- package/node_modules_lambda/escodegen/node_modules/optionator/lib/help.js +0 -260
- package/node_modules_lambda/escodegen/node_modules/optionator/lib/index.js +0 -465
- package/node_modules_lambda/escodegen/node_modules/optionator/lib/util.js +0 -54
- package/node_modules_lambda/escodegen/node_modules/optionator/package.json +0 -44
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/CHANGELOG.md +0 -99
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/LICENSE +0 -22
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/README.md +0 -15
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Func.js +0 -65
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/List.js +0 -686
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Num.js +0 -130
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Obj.js +0 -154
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/Str.js +0 -92
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/lib/index.js +0 -178
- package/node_modules_lambda/escodegen/node_modules/prelude-ls/package.json +0 -52
- package/node_modules_lambda/escodegen/node_modules/source-map/CHANGELOG.md +0 -301
- package/node_modules_lambda/escodegen/node_modules/source-map/LICENSE +0 -28
- package/node_modules_lambda/escodegen/node_modules/source-map/README.md +0 -742
- package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.debug.js +0 -3234
- package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.js +0 -3233
- package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.min.js +0 -2
- package/node_modules_lambda/escodegen/node_modules/source-map/dist/source-map.min.js.map +0 -1
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/array-set.js +0 -121
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/base64-vlq.js +0 -140
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/base64.js +0 -67
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/binary-search.js +0 -111
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/mapping-list.js +0 -79
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/quick-sort.js +0 -114
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-map-consumer.js +0 -1145
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-map-generator.js +0 -425
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/source-node.js +0 -413
- package/node_modules_lambda/escodegen/node_modules/source-map/lib/util.js +0 -488
- package/node_modules_lambda/escodegen/node_modules/source-map/package.json +0 -73
- package/node_modules_lambda/escodegen/node_modules/source-map/source-map.d.ts +0 -98
- package/node_modules_lambda/escodegen/node_modules/source-map/source-map.js +0 -8
- package/node_modules_lambda/escodegen/node_modules/type-check/LICENSE +0 -22
- package/node_modules_lambda/escodegen/node_modules/type-check/README.md +0 -210
- package/node_modules_lambda/escodegen/node_modules/type-check/lib/check.js +0 -126
- package/node_modules_lambda/escodegen/node_modules/type-check/lib/index.js +0 -16
- package/node_modules_lambda/escodegen/node_modules/type-check/lib/parse-type.js +0 -196
- package/node_modules_lambda/escodegen/node_modules/type-check/package.json +0 -40
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/.github/dependabot.yml +0 -11
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/Changelog.md +0 -212
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/LICENSE +0 -21
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/README.md +0 -130
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -597
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-data.js +0 -188
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/index.js +0 -23
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/internal.js +0 -198
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data.js +0 -179
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -56
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf16.js +0 -197
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf32.js +0 -319
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/encodings/utf7.js +0 -290
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/bom-handling.js +0 -52
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/index.d.ts +0 -41
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/index.js +0 -180
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/lib/streams.js +0 -109
- package/node_modules_lambda/whatwg-encoding/node_modules/iconv-lite/package.json +0 -44
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
//.CommonJS
|
|
2
|
-
var CSSOM = {
|
|
3
|
-
CSSValue: require('./CSSValue').CSSValue
|
|
4
|
-
};
|
|
5
|
-
///CommonJS
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @constructor
|
|
10
|
-
* @see http://msdn.microsoft.com/en-us/library/ms537634(v=vs.85).aspx
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
CSSOM.CSSValueExpression = function CSSValueExpression(token, idx) {
|
|
14
|
-
this._token = token;
|
|
15
|
-
this._idx = idx;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
CSSOM.CSSValueExpression.prototype = new CSSOM.CSSValue();
|
|
19
|
-
CSSOM.CSSValueExpression.prototype.constructor = CSSOM.CSSValueExpression;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* parse css expression() value
|
|
23
|
-
*
|
|
24
|
-
* @return {Object}
|
|
25
|
-
* - error:
|
|
26
|
-
* or
|
|
27
|
-
* - idx:
|
|
28
|
-
* - expression:
|
|
29
|
-
*
|
|
30
|
-
* Example:
|
|
31
|
-
*
|
|
32
|
-
* .selector {
|
|
33
|
-
* zoom: expression(documentElement.clientWidth > 1000 ? '1000px' : 'auto');
|
|
34
|
-
* }
|
|
35
|
-
*/
|
|
36
|
-
CSSOM.CSSValueExpression.prototype.parse = function() {
|
|
37
|
-
var token = this._token,
|
|
38
|
-
idx = this._idx;
|
|
39
|
-
|
|
40
|
-
var character = '',
|
|
41
|
-
expression = '',
|
|
42
|
-
error = '',
|
|
43
|
-
info,
|
|
44
|
-
paren = [];
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
for (; ; ++idx) {
|
|
48
|
-
character = token.charAt(idx);
|
|
49
|
-
|
|
50
|
-
// end of token
|
|
51
|
-
if (character === '') {
|
|
52
|
-
error = 'css expression error: unfinished expression!';
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
switch(character) {
|
|
57
|
-
case '(':
|
|
58
|
-
paren.push(character);
|
|
59
|
-
expression += character;
|
|
60
|
-
break;
|
|
61
|
-
|
|
62
|
-
case ')':
|
|
63
|
-
paren.pop(character);
|
|
64
|
-
expression += character;
|
|
65
|
-
break;
|
|
66
|
-
|
|
67
|
-
case '/':
|
|
68
|
-
if ((info = this._parseJSComment(token, idx))) { // comment?
|
|
69
|
-
if (info.error) {
|
|
70
|
-
error = 'css expression error: unfinished comment in expression!';
|
|
71
|
-
} else {
|
|
72
|
-
idx = info.idx;
|
|
73
|
-
// ignore the comment
|
|
74
|
-
}
|
|
75
|
-
} else if ((info = this._parseJSRexExp(token, idx))) { // regexp
|
|
76
|
-
idx = info.idx;
|
|
77
|
-
expression += info.text;
|
|
78
|
-
} else { // other
|
|
79
|
-
expression += character;
|
|
80
|
-
}
|
|
81
|
-
break;
|
|
82
|
-
|
|
83
|
-
case "'":
|
|
84
|
-
case '"':
|
|
85
|
-
info = this._parseJSString(token, idx, character);
|
|
86
|
-
if (info) { // string
|
|
87
|
-
idx = info.idx;
|
|
88
|
-
expression += info.text;
|
|
89
|
-
} else {
|
|
90
|
-
expression += character;
|
|
91
|
-
}
|
|
92
|
-
break;
|
|
93
|
-
|
|
94
|
-
default:
|
|
95
|
-
expression += character;
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (error) {
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// end of expression
|
|
104
|
-
if (paren.length === 0) {
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
var ret;
|
|
110
|
-
if (error) {
|
|
111
|
-
ret = {
|
|
112
|
-
error: error
|
|
113
|
-
};
|
|
114
|
-
} else {
|
|
115
|
-
ret = {
|
|
116
|
-
idx: idx,
|
|
117
|
-
expression: expression
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return ret;
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
*
|
|
127
|
-
* @return {Object|false}
|
|
128
|
-
* - idx:
|
|
129
|
-
* - text:
|
|
130
|
-
* or
|
|
131
|
-
* - error:
|
|
132
|
-
* or
|
|
133
|
-
* false
|
|
134
|
-
*
|
|
135
|
-
*/
|
|
136
|
-
CSSOM.CSSValueExpression.prototype._parseJSComment = function(token, idx) {
|
|
137
|
-
var nextChar = token.charAt(idx + 1),
|
|
138
|
-
text;
|
|
139
|
-
|
|
140
|
-
if (nextChar === '/' || nextChar === '*') {
|
|
141
|
-
var startIdx = idx,
|
|
142
|
-
endIdx,
|
|
143
|
-
commentEndChar;
|
|
144
|
-
|
|
145
|
-
if (nextChar === '/') { // line comment
|
|
146
|
-
commentEndChar = '\n';
|
|
147
|
-
} else if (nextChar === '*') { // block comment
|
|
148
|
-
commentEndChar = '*/';
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
endIdx = token.indexOf(commentEndChar, startIdx + 1 + 1);
|
|
152
|
-
if (endIdx !== -1) {
|
|
153
|
-
endIdx = endIdx + commentEndChar.length - 1;
|
|
154
|
-
text = token.substring(idx, endIdx + 1);
|
|
155
|
-
return {
|
|
156
|
-
idx: endIdx,
|
|
157
|
-
text: text
|
|
158
|
-
};
|
|
159
|
-
} else {
|
|
160
|
-
var error = 'css expression error: unfinished comment in expression!';
|
|
161
|
-
return {
|
|
162
|
-
error: error
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
} else {
|
|
166
|
-
return false;
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
*
|
|
173
|
-
* @return {Object|false}
|
|
174
|
-
* - idx:
|
|
175
|
-
* - text:
|
|
176
|
-
* or
|
|
177
|
-
* false
|
|
178
|
-
*
|
|
179
|
-
*/
|
|
180
|
-
CSSOM.CSSValueExpression.prototype._parseJSString = function(token, idx, sep) {
|
|
181
|
-
var endIdx = this._findMatchedIdx(token, idx, sep),
|
|
182
|
-
text;
|
|
183
|
-
|
|
184
|
-
if (endIdx === -1) {
|
|
185
|
-
return false;
|
|
186
|
-
} else {
|
|
187
|
-
text = token.substring(idx, endIdx + sep.length);
|
|
188
|
-
|
|
189
|
-
return {
|
|
190
|
-
idx: endIdx,
|
|
191
|
-
text: text
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* parse regexp in css expression
|
|
199
|
-
*
|
|
200
|
-
* @return {Object|false}
|
|
201
|
-
* - idx:
|
|
202
|
-
* - regExp:
|
|
203
|
-
* or
|
|
204
|
-
* false
|
|
205
|
-
*/
|
|
206
|
-
|
|
207
|
-
/*
|
|
208
|
-
|
|
209
|
-
all legal RegExp
|
|
210
|
-
|
|
211
|
-
/a/
|
|
212
|
-
(/a/)
|
|
213
|
-
[/a/]
|
|
214
|
-
[12, /a/]
|
|
215
|
-
|
|
216
|
-
!/a/
|
|
217
|
-
|
|
218
|
-
+/a/
|
|
219
|
-
-/a/
|
|
220
|
-
* /a/
|
|
221
|
-
/ /a/
|
|
222
|
-
%/a/
|
|
223
|
-
|
|
224
|
-
===/a/
|
|
225
|
-
!==/a/
|
|
226
|
-
==/a/
|
|
227
|
-
!=/a/
|
|
228
|
-
>/a/
|
|
229
|
-
>=/a/
|
|
230
|
-
</a/
|
|
231
|
-
<=/a/
|
|
232
|
-
|
|
233
|
-
&/a/
|
|
234
|
-
|/a/
|
|
235
|
-
^/a/
|
|
236
|
-
~/a/
|
|
237
|
-
<</a/
|
|
238
|
-
>>/a/
|
|
239
|
-
>>>/a/
|
|
240
|
-
|
|
241
|
-
&&/a/
|
|
242
|
-
||/a/
|
|
243
|
-
?/a/
|
|
244
|
-
=/a/
|
|
245
|
-
,/a/
|
|
246
|
-
|
|
247
|
-
delete /a/
|
|
248
|
-
in /a/
|
|
249
|
-
instanceof /a/
|
|
250
|
-
new /a/
|
|
251
|
-
typeof /a/
|
|
252
|
-
void /a/
|
|
253
|
-
|
|
254
|
-
*/
|
|
255
|
-
CSSOM.CSSValueExpression.prototype._parseJSRexExp = function(token, idx) {
|
|
256
|
-
var before = token.substring(0, idx).replace(/\s+$/, ""),
|
|
257
|
-
legalRegx = [
|
|
258
|
-
/^$/,
|
|
259
|
-
/\($/,
|
|
260
|
-
/\[$/,
|
|
261
|
-
/\!$/,
|
|
262
|
-
/\+$/,
|
|
263
|
-
/\-$/,
|
|
264
|
-
/\*$/,
|
|
265
|
-
/\/\s+/,
|
|
266
|
-
/\%$/,
|
|
267
|
-
/\=$/,
|
|
268
|
-
/\>$/,
|
|
269
|
-
/<$/,
|
|
270
|
-
/\&$/,
|
|
271
|
-
/\|$/,
|
|
272
|
-
/\^$/,
|
|
273
|
-
/\~$/,
|
|
274
|
-
/\?$/,
|
|
275
|
-
/\,$/,
|
|
276
|
-
/delete$/,
|
|
277
|
-
/in$/,
|
|
278
|
-
/instanceof$/,
|
|
279
|
-
/new$/,
|
|
280
|
-
/typeof$/,
|
|
281
|
-
/void$/
|
|
282
|
-
];
|
|
283
|
-
|
|
284
|
-
var isLegal = legalRegx.some(function(reg) {
|
|
285
|
-
return reg.test(before);
|
|
286
|
-
});
|
|
287
|
-
|
|
288
|
-
if (!isLegal) {
|
|
289
|
-
return false;
|
|
290
|
-
} else {
|
|
291
|
-
var sep = '/';
|
|
292
|
-
|
|
293
|
-
// same logic as string
|
|
294
|
-
return this._parseJSString(token, idx, sep);
|
|
295
|
-
}
|
|
296
|
-
};
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
*
|
|
301
|
-
* find next sep(same line) index in `token`
|
|
302
|
-
*
|
|
303
|
-
* @return {Number}
|
|
304
|
-
*
|
|
305
|
-
*/
|
|
306
|
-
CSSOM.CSSValueExpression.prototype._findMatchedIdx = function(token, idx, sep) {
|
|
307
|
-
var startIdx = idx,
|
|
308
|
-
endIdx;
|
|
309
|
-
|
|
310
|
-
var NOT_FOUND = -1;
|
|
311
|
-
|
|
312
|
-
while(true) {
|
|
313
|
-
endIdx = token.indexOf(sep, startIdx + 1);
|
|
314
|
-
|
|
315
|
-
if (endIdx === -1) { // not found
|
|
316
|
-
endIdx = NOT_FOUND;
|
|
317
|
-
break;
|
|
318
|
-
} else {
|
|
319
|
-
var text = token.substring(idx + 1, endIdx),
|
|
320
|
-
matched = text.match(/\\+$/);
|
|
321
|
-
if (!matched || matched[0] % 2 === 0) { // not escaped
|
|
322
|
-
break;
|
|
323
|
-
} else {
|
|
324
|
-
startIdx = endIdx;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
// boundary must be in the same line(js sting or regexp)
|
|
330
|
-
var nextNewLineIdx = token.indexOf('\n', idx + 1);
|
|
331
|
-
if (nextNewLineIdx < endIdx) {
|
|
332
|
-
endIdx = NOT_FOUND;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
return endIdx;
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
//.CommonJS
|
|
343
|
-
exports.CSSValueExpression = CSSOM.CSSValueExpression;
|
|
344
|
-
///CommonJS
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
//.CommonJS
|
|
2
|
-
var CSSOM = {};
|
|
3
|
-
///CommonJS
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @constructor
|
|
8
|
-
* @see https://developer.mozilla.org/en/CSS/@-moz-document
|
|
9
|
-
*/
|
|
10
|
-
CSSOM.MatcherList = function MatcherList(){
|
|
11
|
-
this.length = 0;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
CSSOM.MatcherList.prototype = {
|
|
15
|
-
|
|
16
|
-
constructor: CSSOM.MatcherList,
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @return {string}
|
|
20
|
-
*/
|
|
21
|
-
get matcherText() {
|
|
22
|
-
return Array.prototype.join.call(this, ", ");
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @param {string} value
|
|
27
|
-
*/
|
|
28
|
-
set matcherText(value) {
|
|
29
|
-
// just a temporary solution, actually it may be wrong by just split the value with ',', because a url can include ','.
|
|
30
|
-
var values = value.split(",");
|
|
31
|
-
var length = this.length = values.length;
|
|
32
|
-
for (var i=0; i<length; i++) {
|
|
33
|
-
this[i] = values[i].trim();
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @param {string} matcher
|
|
39
|
-
*/
|
|
40
|
-
appendMatcher: function(matcher) {
|
|
41
|
-
if (Array.prototype.indexOf.call(this, matcher) === -1) {
|
|
42
|
-
this[this.length] = matcher;
|
|
43
|
-
this.length++;
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @param {string} matcher
|
|
49
|
-
*/
|
|
50
|
-
deleteMatcher: function(matcher) {
|
|
51
|
-
var index = Array.prototype.indexOf.call(this, matcher);
|
|
52
|
-
if (index !== -1) {
|
|
53
|
-
Array.prototype.splice.call(this, index, 1);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
//.CommonJS
|
|
61
|
-
exports.MatcherList = CSSOM.MatcherList;
|
|
62
|
-
///CommonJS
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
//.CommonJS
|
|
2
|
-
var CSSOM = {};
|
|
3
|
-
///CommonJS
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @constructor
|
|
8
|
-
* @see http://dev.w3.org/csswg/cssom/#the-medialist-interface
|
|
9
|
-
*/
|
|
10
|
-
CSSOM.MediaList = function MediaList(){
|
|
11
|
-
this.length = 0;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
CSSOM.MediaList.prototype = {
|
|
15
|
-
|
|
16
|
-
constructor: CSSOM.MediaList,
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @return {string}
|
|
20
|
-
*/
|
|
21
|
-
get mediaText() {
|
|
22
|
-
return Array.prototype.join.call(this, ", ");
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @param {string} value
|
|
27
|
-
*/
|
|
28
|
-
set mediaText(value) {
|
|
29
|
-
var values = value.split(",");
|
|
30
|
-
var length = this.length = values.length;
|
|
31
|
-
for (var i=0; i<length; i++) {
|
|
32
|
-
this[i] = values[i].trim();
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @param {string} medium
|
|
38
|
-
*/
|
|
39
|
-
appendMedium: function(medium) {
|
|
40
|
-
if (Array.prototype.indexOf.call(this, medium) === -1) {
|
|
41
|
-
this[this.length] = medium;
|
|
42
|
-
this.length++;
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @param {string} medium
|
|
48
|
-
*/
|
|
49
|
-
deleteMedium: function(medium) {
|
|
50
|
-
var index = Array.prototype.indexOf.call(this, medium);
|
|
51
|
-
if (index !== -1) {
|
|
52
|
-
Array.prototype.splice.call(this, index, 1);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
//.CommonJS
|
|
60
|
-
exports.MediaList = CSSOM.MediaList;
|
|
61
|
-
///CommonJS
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//.CommonJS
|
|
2
|
-
var CSSOM = {};
|
|
3
|
-
///CommonJS
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @constructor
|
|
8
|
-
* @see http://dev.w3.org/csswg/cssom/#the-stylesheet-interface
|
|
9
|
-
*/
|
|
10
|
-
CSSOM.StyleSheet = function StyleSheet() {
|
|
11
|
-
this.parentStyleSheet = null;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//.CommonJS
|
|
16
|
-
exports.StyleSheet = CSSOM.StyleSheet;
|
|
17
|
-
///CommonJS
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
//.CommonJS
|
|
2
|
-
var CSSOM = {
|
|
3
|
-
CSSStyleSheet: require("./CSSStyleSheet").CSSStyleSheet,
|
|
4
|
-
CSSStyleRule: require("./CSSStyleRule").CSSStyleRule,
|
|
5
|
-
CSSMediaRule: require("./CSSMediaRule").CSSMediaRule,
|
|
6
|
-
CSSSupportsRule: require("./CSSSupportsRule").CSSSupportsRule,
|
|
7
|
-
CSSStyleDeclaration: require("./CSSStyleDeclaration").CSSStyleDeclaration,
|
|
8
|
-
CSSKeyframeRule: require('./CSSKeyframeRule').CSSKeyframeRule,
|
|
9
|
-
CSSKeyframesRule: require('./CSSKeyframesRule').CSSKeyframesRule
|
|
10
|
-
};
|
|
11
|
-
///CommonJS
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Produces a deep copy of stylesheet — the instance variables of stylesheet are copied recursively.
|
|
16
|
-
* @param {CSSStyleSheet|CSSOM.CSSStyleSheet} stylesheet
|
|
17
|
-
* @nosideeffects
|
|
18
|
-
* @return {CSSOM.CSSStyleSheet}
|
|
19
|
-
*/
|
|
20
|
-
CSSOM.clone = function clone(stylesheet) {
|
|
21
|
-
|
|
22
|
-
var cloned = new CSSOM.CSSStyleSheet();
|
|
23
|
-
|
|
24
|
-
var rules = stylesheet.cssRules;
|
|
25
|
-
if (!rules) {
|
|
26
|
-
return cloned;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var RULE_TYPES = {
|
|
30
|
-
1: CSSOM.CSSStyleRule,
|
|
31
|
-
4: CSSOM.CSSMediaRule,
|
|
32
|
-
//3: CSSOM.CSSImportRule,
|
|
33
|
-
//5: CSSOM.CSSFontFaceRule,
|
|
34
|
-
//6: CSSOM.CSSPageRule,
|
|
35
|
-
8: CSSOM.CSSKeyframesRule,
|
|
36
|
-
9: CSSOM.CSSKeyframeRule,
|
|
37
|
-
12: CSSOM.CSSSupportsRule
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
for (var i=0, rulesLength=rules.length; i < rulesLength; i++) {
|
|
41
|
-
var rule = rules[i];
|
|
42
|
-
var ruleClone = cloned.cssRules[i] = new RULE_TYPES[rule.type]();
|
|
43
|
-
|
|
44
|
-
var style = rule.style;
|
|
45
|
-
if (style) {
|
|
46
|
-
var styleClone = ruleClone.style = new CSSOM.CSSStyleDeclaration();
|
|
47
|
-
for (var j=0, styleLength=style.length; j < styleLength; j++) {
|
|
48
|
-
var name = styleClone[j] = style[j];
|
|
49
|
-
styleClone[name] = style[name];
|
|
50
|
-
styleClone._importants[name] = style.getPropertyPriority(name);
|
|
51
|
-
}
|
|
52
|
-
styleClone.length = style.length;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (rule.hasOwnProperty('keyText')) {
|
|
56
|
-
ruleClone.keyText = rule.keyText;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (rule.hasOwnProperty('selectorText')) {
|
|
60
|
-
ruleClone.selectorText = rule.selectorText;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (rule.hasOwnProperty('mediaText')) {
|
|
64
|
-
ruleClone.mediaText = rule.mediaText;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (rule.hasOwnProperty('conditionText')) {
|
|
68
|
-
ruleClone.conditionText = rule.conditionText;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (rule.hasOwnProperty('cssRules')) {
|
|
72
|
-
ruleClone.cssRules = clone(rule).cssRules;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return cloned;
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
//.CommonJS
|
|
81
|
-
exports.clone = CSSOM.clone;
|
|
82
|
-
///CommonJS
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
exports.CSSStyleDeclaration = require('./CSSStyleDeclaration').CSSStyleDeclaration;
|
|
4
|
-
exports.CSSRule = require('./CSSRule').CSSRule;
|
|
5
|
-
exports.CSSStyleRule = require('./CSSStyleRule').CSSStyleRule;
|
|
6
|
-
exports.MediaList = require('./MediaList').MediaList;
|
|
7
|
-
exports.CSSMediaRule = require('./CSSMediaRule').CSSMediaRule;
|
|
8
|
-
exports.CSSSupportsRule = require('./CSSSupportsRule').CSSSupportsRule;
|
|
9
|
-
exports.CSSImportRule = require('./CSSImportRule').CSSImportRule;
|
|
10
|
-
exports.CSSFontFaceRule = require('./CSSFontFaceRule').CSSFontFaceRule;
|
|
11
|
-
exports.CSSHostRule = require('./CSSHostRule').CSSHostRule;
|
|
12
|
-
exports.StyleSheet = require('./StyleSheet').StyleSheet;
|
|
13
|
-
exports.CSSStyleSheet = require('./CSSStyleSheet').CSSStyleSheet;
|
|
14
|
-
exports.CSSKeyframesRule = require('./CSSKeyframesRule').CSSKeyframesRule;
|
|
15
|
-
exports.CSSKeyframeRule = require('./CSSKeyframeRule').CSSKeyframeRule;
|
|
16
|
-
exports.MatcherList = require('./MatcherList').MatcherList;
|
|
17
|
-
exports.CSSDocumentRule = require('./CSSDocumentRule').CSSDocumentRule;
|
|
18
|
-
exports.CSSValue = require('./CSSValue').CSSValue;
|
|
19
|
-
exports.CSSValueExpression = require('./CSSValueExpression').CSSValueExpression;
|
|
20
|
-
exports.parse = require('./parse').parse;
|
|
21
|
-
exports.clone = require('./clone').clone;
|