@gct-paas/core-web 0.0.1-dev.16 → 0.0.1-dev.17
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/core-web.css +1 -1
- package/dist/index.min.cjs +12 -3
- package/dist/index.system.min.js +12 -3
- package/es/_virtual/_commonjsHelpers.mjs +40 -0
- package/es/_virtual/node.mjs +7 -0
- package/es/_virtual/node2.mjs +3 -0
- package/es/editor/gct-form-color/gct-form-color.d.ts +1 -33
- package/es/editor/gct-form-color/gct-form-color.mjs +14 -5
- package/es/editor/gct-form-color/index.d.ts +3 -0
- package/es/editor/gct-form-color/index.mjs +7 -2
- package/es/editor/gct-form-number/index.d.ts +3 -0
- package/es/editor/gct-form-number/index.mjs +7 -2
- package/es/editor/index.mjs +4 -2
- package/es/index.d.ts +0 -1
- package/es/index.mjs +1 -1
- package/es/node_modules/.pnpm/@aesoper_normal-utils@0.1.5/node_modules/@aesoper/normal-utils/NormalUtils.es.mjs +3 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/createPopper.mjs +200 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/contains.mjs +26 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.mjs +44 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.mjs +72 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.mjs +60 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.mjs +7 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.mjs +9 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.mjs +32 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.mjs +8 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.mjs +28 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getNodeName.mjs +5 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.mjs +14 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.mjs +71 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getParentNode.mjs +22 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.mjs +19 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getViewportRect.mjs +34 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindow.mjs +14 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.mjs +13 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.mjs +16 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/instanceOf.mjs +23 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.mjs +7 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.mjs +13 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isTableElement.mjs +7 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.mjs +29 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/enums.mjs +33 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/index.mjs +5 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/applyStyles.mjs +87 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/arrow.mjs +92 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/computeStyles.mjs +171 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/eventListeners.mjs +51 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/flip.mjs +149 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/hide.mjs +63 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/index.mjs +9 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/offset.mjs +56 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/popperOffsets.mjs +27 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/preventOverflow.mjs +144 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/popper-lite.mjs +12 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/popper.mjs +19 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.mjs +46 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/computeOffsets.mjs +73 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/debounce.mjs +17 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/detectOverflow.mjs +67 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/expandToHashMap.mjs +8 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getAltAxis.mjs +5 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getBasePlacement.mjs +7 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getFreshSideObject.mjs +10 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.mjs +5 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getOppositePlacement.mjs +13 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.mjs +11 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getVariation.mjs +5 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/math.mjs +5 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/mergeByName.mjs +16 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/mergePaddingObject.mjs +7 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/orderModifiers.mjs +46 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/rectToClientRect.mjs +10 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/userAgent.mjs +13 -0
- package/es/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/within.mjs +11 -0
- package/es/node_modules/.pnpm/@vueuse_core@10.11.1_vue@3.5.13_typescript@5.8.2_/node_modules/@vueuse/core/index.mjs +7487 -0
- package/es/node_modules/.pnpm/@vueuse_shared@10.11.1_vue@3.5.13_typescript@5.8.2_/node_modules/@vueuse/shared/index.mjs +1576 -0
- package/es/node_modules/.pnpm/gradient-parser@1.0.2/node_modules/gradient-parser/build/node.mjs +528 -0
- package/es/node_modules/.pnpm/tinycolor2@1.6.0/node_modules/tinycolor2/esm/tinycolor.mjs +1180 -0
- package/es/node_modules/.pnpm/vue-demi@0.14.10_vue@3.5.13_typescript@5.8.2_/node_modules/vue-demi/lib/index.mjs +29 -0
- package/es/node_modules/.pnpm/vue-types@3.0.2_vue@3.5.13_typescript@5.8.2_/node_modules/vue-types/dist/vue-types.m.mjs +3 -0
- package/es/node_modules/.pnpm/vue3-colorpicker@2.3.0_@aesoper_normal-utils@0.1.5_@popperjs_core@2.11.8_@vueuse_core@10.11.1_67dx55qyw5ulzyggoxgyarn5m4/node_modules/vue3-colorpicker/index.es.mjs +1815 -0
- package/package.json +7 -6
package/es/node_modules/.pnpm/gradient-parser@1.0.2/node_modules/gradient-parser/build/node.mjs
ADDED
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
import '../../../../../../_virtual/_commonjsHelpers.mjs';
|
|
2
|
+
import { __exports as node } from '../../../../../../_virtual/node2.mjs';
|
|
3
|
+
|
|
4
|
+
var hasRequiredNode;
|
|
5
|
+
|
|
6
|
+
function requireNode () {
|
|
7
|
+
if (hasRequiredNode) return node;
|
|
8
|
+
hasRequiredNode = 1;
|
|
9
|
+
// Copyright (c) 2014 Rafael Caricio. All rights reserved.
|
|
10
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
11
|
+
// found in the LICENSE file.
|
|
12
|
+
|
|
13
|
+
var GradientParser = (GradientParser || {});
|
|
14
|
+
|
|
15
|
+
GradientParser.stringify = (function() {
|
|
16
|
+
|
|
17
|
+
var visitor = {
|
|
18
|
+
|
|
19
|
+
'visit_linear-gradient': function(node) {
|
|
20
|
+
return visitor.visit_gradient(node);
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
'visit_repeating-linear-gradient': function(node) {
|
|
24
|
+
return visitor.visit_gradient(node);
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
'visit_radial-gradient': function(node) {
|
|
28
|
+
return visitor.visit_gradient(node);
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
'visit_repeating-radial-gradient': function(node) {
|
|
32
|
+
return visitor.visit_gradient(node);
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
'visit_gradient': function(node) {
|
|
36
|
+
var orientation = visitor.visit(node.orientation);
|
|
37
|
+
if (orientation) {
|
|
38
|
+
orientation += ', ';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return node.type + '(' + orientation + visitor.visit(node.colorStops) + ')';
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
'visit_shape': function(node) {
|
|
45
|
+
var result = node.value,
|
|
46
|
+
at = visitor.visit(node.at),
|
|
47
|
+
style = visitor.visit(node.style);
|
|
48
|
+
|
|
49
|
+
if (style) {
|
|
50
|
+
result += ' ' + style;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (at) {
|
|
54
|
+
result += ' at ' + at;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return result;
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
'visit_default-radial': function(node) {
|
|
61
|
+
var result = '',
|
|
62
|
+
at = visitor.visit(node.at);
|
|
63
|
+
|
|
64
|
+
if (at) {
|
|
65
|
+
result += at;
|
|
66
|
+
}
|
|
67
|
+
return result;
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
'visit_extent-keyword': function(node) {
|
|
71
|
+
var result = node.value,
|
|
72
|
+
at = visitor.visit(node.at);
|
|
73
|
+
|
|
74
|
+
if (at) {
|
|
75
|
+
result += ' at ' + at;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return result;
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
'visit_position-keyword': function(node) {
|
|
82
|
+
return node.value;
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
'visit_position': function(node) {
|
|
86
|
+
return visitor.visit(node.value.x) + ' ' + visitor.visit(node.value.y);
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
'visit_%': function(node) {
|
|
90
|
+
return node.value + '%';
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
'visit_em': function(node) {
|
|
94
|
+
return node.value + 'em';
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
'visit_px': function(node) {
|
|
98
|
+
return node.value + 'px';
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
'visit_literal': function(node) {
|
|
102
|
+
return visitor.visit_color(node.value, node);
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
'visit_hex': function(node) {
|
|
106
|
+
return visitor.visit_color('#' + node.value, node);
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
'visit_rgb': function(node) {
|
|
110
|
+
return visitor.visit_color('rgb(' + node.value.join(', ') + ')', node);
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
'visit_rgba': function(node) {
|
|
114
|
+
return visitor.visit_color('rgba(' + node.value.join(', ') + ')', node);
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
'visit_color': function(resultColor, node) {
|
|
118
|
+
var result = resultColor,
|
|
119
|
+
length = visitor.visit(node.length);
|
|
120
|
+
|
|
121
|
+
if (length) {
|
|
122
|
+
result += ' ' + length;
|
|
123
|
+
}
|
|
124
|
+
return result;
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
'visit_angular': function(node) {
|
|
128
|
+
return node.value + 'deg';
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
'visit_directional': function(node) {
|
|
132
|
+
return 'to ' + node.value;
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
'visit_array': function(elements) {
|
|
136
|
+
var result = '',
|
|
137
|
+
size = elements.length;
|
|
138
|
+
|
|
139
|
+
elements.forEach(function(element, i) {
|
|
140
|
+
result += visitor.visit(element);
|
|
141
|
+
if (i < size - 1) {
|
|
142
|
+
result += ', ';
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
return result;
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
'visit': function(element) {
|
|
150
|
+
if (!element) {
|
|
151
|
+
return '';
|
|
152
|
+
}
|
|
153
|
+
var result = '';
|
|
154
|
+
|
|
155
|
+
if (element instanceof Array) {
|
|
156
|
+
return visitor.visit_array(element, result);
|
|
157
|
+
} else if (element.type) {
|
|
158
|
+
var nodeVisitor = visitor['visit_' + element.type];
|
|
159
|
+
if (nodeVisitor) {
|
|
160
|
+
return nodeVisitor(element);
|
|
161
|
+
} else {
|
|
162
|
+
throw Error('Missing visitor visit_' + element.type);
|
|
163
|
+
}
|
|
164
|
+
} else {
|
|
165
|
+
throw Error('Invalid node.');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
return function(root) {
|
|
172
|
+
return visitor.visit(root);
|
|
173
|
+
};
|
|
174
|
+
})();
|
|
175
|
+
|
|
176
|
+
// Copyright (c) 2014 Rafael Caricio. All rights reserved.
|
|
177
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
178
|
+
// found in the LICENSE file.
|
|
179
|
+
|
|
180
|
+
var GradientParser = (GradientParser || {});
|
|
181
|
+
|
|
182
|
+
GradientParser.parse = (function() {
|
|
183
|
+
|
|
184
|
+
var tokens = {
|
|
185
|
+
linearGradient: /^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,
|
|
186
|
+
repeatingLinearGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,
|
|
187
|
+
radialGradient: /^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,
|
|
188
|
+
repeatingRadialGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,
|
|
189
|
+
sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,
|
|
190
|
+
extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,
|
|
191
|
+
positionKeywords: /^(left|center|right|top|bottom)/i,
|
|
192
|
+
pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,
|
|
193
|
+
percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,
|
|
194
|
+
emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,
|
|
195
|
+
angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,
|
|
196
|
+
startCall: /^\(/,
|
|
197
|
+
endCall: /^\)/,
|
|
198
|
+
comma: /^,/,
|
|
199
|
+
hexColor: /^\#([0-9a-fA-F]+)/,
|
|
200
|
+
literalColor: /^([a-zA-Z]+)/,
|
|
201
|
+
rgbColor: /^rgb/i,
|
|
202
|
+
rgbaColor: /^rgba/i,
|
|
203
|
+
number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
var input = '';
|
|
207
|
+
|
|
208
|
+
function error(msg) {
|
|
209
|
+
var err = new Error(input + ': ' + msg);
|
|
210
|
+
err.source = input;
|
|
211
|
+
throw err;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function getAST() {
|
|
215
|
+
var ast = matchListDefinitions();
|
|
216
|
+
|
|
217
|
+
if (input.length > 0) {
|
|
218
|
+
error('Invalid input not EOF');
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return ast;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function matchListDefinitions() {
|
|
225
|
+
return matchListing(matchDefinition);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function matchDefinition() {
|
|
229
|
+
return matchGradient(
|
|
230
|
+
'linear-gradient',
|
|
231
|
+
tokens.linearGradient,
|
|
232
|
+
matchLinearOrientation) ||
|
|
233
|
+
|
|
234
|
+
matchGradient(
|
|
235
|
+
'repeating-linear-gradient',
|
|
236
|
+
tokens.repeatingLinearGradient,
|
|
237
|
+
matchLinearOrientation) ||
|
|
238
|
+
|
|
239
|
+
matchGradient(
|
|
240
|
+
'radial-gradient',
|
|
241
|
+
tokens.radialGradient,
|
|
242
|
+
matchListRadialOrientations) ||
|
|
243
|
+
|
|
244
|
+
matchGradient(
|
|
245
|
+
'repeating-radial-gradient',
|
|
246
|
+
tokens.repeatingRadialGradient,
|
|
247
|
+
matchListRadialOrientations);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function matchGradient(gradientType, pattern, orientationMatcher) {
|
|
251
|
+
return matchCall(pattern, function(captures) {
|
|
252
|
+
|
|
253
|
+
var orientation = orientationMatcher();
|
|
254
|
+
if (orientation) {
|
|
255
|
+
if (!scan(tokens.comma)) {
|
|
256
|
+
error('Missing comma before color stops');
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return {
|
|
261
|
+
type: gradientType,
|
|
262
|
+
orientation: orientation,
|
|
263
|
+
colorStops: matchListing(matchColorStop)
|
|
264
|
+
};
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function matchCall(pattern, callback) {
|
|
269
|
+
var captures = scan(pattern);
|
|
270
|
+
|
|
271
|
+
if (captures) {
|
|
272
|
+
if (!scan(tokens.startCall)) {
|
|
273
|
+
error('Missing (');
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
var result = callback(captures);
|
|
277
|
+
|
|
278
|
+
if (!scan(tokens.endCall)) {
|
|
279
|
+
error('Missing )');
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return result;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function matchLinearOrientation() {
|
|
287
|
+
return matchSideOrCorner() ||
|
|
288
|
+
matchAngle();
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function matchSideOrCorner() {
|
|
292
|
+
return match('directional', tokens.sideOrCorner, 1);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function matchAngle() {
|
|
296
|
+
return match('angular', tokens.angleValue, 1);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
function matchListRadialOrientations() {
|
|
300
|
+
var radialOrientations,
|
|
301
|
+
radialOrientation = matchRadialOrientation(),
|
|
302
|
+
lookaheadCache;
|
|
303
|
+
|
|
304
|
+
if (radialOrientation) {
|
|
305
|
+
radialOrientations = [];
|
|
306
|
+
radialOrientations.push(radialOrientation);
|
|
307
|
+
|
|
308
|
+
lookaheadCache = input;
|
|
309
|
+
if (scan(tokens.comma)) {
|
|
310
|
+
radialOrientation = matchRadialOrientation();
|
|
311
|
+
if (radialOrientation) {
|
|
312
|
+
radialOrientations.push(radialOrientation);
|
|
313
|
+
} else {
|
|
314
|
+
input = lookaheadCache;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
return radialOrientations;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function matchRadialOrientation() {
|
|
323
|
+
var radialType = matchCircle() ||
|
|
324
|
+
matchEllipse();
|
|
325
|
+
|
|
326
|
+
if (radialType) {
|
|
327
|
+
radialType.at = matchAtPosition();
|
|
328
|
+
} else {
|
|
329
|
+
var extent = matchExtentKeyword();
|
|
330
|
+
if (extent) {
|
|
331
|
+
radialType = extent;
|
|
332
|
+
var positionAt = matchAtPosition();
|
|
333
|
+
if (positionAt) {
|
|
334
|
+
radialType.at = positionAt;
|
|
335
|
+
}
|
|
336
|
+
} else {
|
|
337
|
+
var defaultPosition = matchPositioning();
|
|
338
|
+
if (defaultPosition) {
|
|
339
|
+
radialType = {
|
|
340
|
+
type: 'default-radial',
|
|
341
|
+
at: defaultPosition
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
return radialType;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
function matchCircle() {
|
|
351
|
+
var circle = match('shape', /^(circle)/i, 0);
|
|
352
|
+
|
|
353
|
+
if (circle) {
|
|
354
|
+
circle.style = matchLength() || matchExtentKeyword();
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
return circle;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
function matchEllipse() {
|
|
361
|
+
var ellipse = match('shape', /^(ellipse)/i, 0);
|
|
362
|
+
|
|
363
|
+
if (ellipse) {
|
|
364
|
+
ellipse.style = matchDistance() || matchExtentKeyword();
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
return ellipse;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
function matchExtentKeyword() {
|
|
371
|
+
return match('extent-keyword', tokens.extentKeywords, 1);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
function matchAtPosition() {
|
|
375
|
+
if (match('position', /^at/, 0)) {
|
|
376
|
+
var positioning = matchPositioning();
|
|
377
|
+
|
|
378
|
+
if (!positioning) {
|
|
379
|
+
error('Missing positioning value');
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
return positioning;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
function matchPositioning() {
|
|
387
|
+
var location = matchCoordinates();
|
|
388
|
+
|
|
389
|
+
if (location.x || location.y) {
|
|
390
|
+
return {
|
|
391
|
+
type: 'position',
|
|
392
|
+
value: location
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
function matchCoordinates() {
|
|
398
|
+
return {
|
|
399
|
+
x: matchDistance(),
|
|
400
|
+
y: matchDistance()
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
function matchListing(matcher) {
|
|
405
|
+
var captures = matcher(),
|
|
406
|
+
result = [];
|
|
407
|
+
|
|
408
|
+
if (captures) {
|
|
409
|
+
result.push(captures);
|
|
410
|
+
while (scan(tokens.comma)) {
|
|
411
|
+
captures = matcher();
|
|
412
|
+
if (captures) {
|
|
413
|
+
result.push(captures);
|
|
414
|
+
} else {
|
|
415
|
+
error('One extra comma');
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
return result;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
function matchColorStop() {
|
|
424
|
+
var color = matchColor();
|
|
425
|
+
|
|
426
|
+
if (!color) {
|
|
427
|
+
error('Expected color definition');
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
color.length = matchDistance();
|
|
431
|
+
return color;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
function matchColor() {
|
|
435
|
+
return matchHexColor() ||
|
|
436
|
+
matchRGBAColor() ||
|
|
437
|
+
matchRGBColor() ||
|
|
438
|
+
matchLiteralColor();
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
function matchLiteralColor() {
|
|
442
|
+
return match('literal', tokens.literalColor, 0);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
function matchHexColor() {
|
|
446
|
+
return match('hex', tokens.hexColor, 1);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
function matchRGBColor() {
|
|
450
|
+
return matchCall(tokens.rgbColor, function() {
|
|
451
|
+
return {
|
|
452
|
+
type: 'rgb',
|
|
453
|
+
value: matchListing(matchNumber)
|
|
454
|
+
};
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
function matchRGBAColor() {
|
|
459
|
+
return matchCall(tokens.rgbaColor, function() {
|
|
460
|
+
return {
|
|
461
|
+
type: 'rgba',
|
|
462
|
+
value: matchListing(matchNumber)
|
|
463
|
+
};
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
function matchNumber() {
|
|
468
|
+
return scan(tokens.number)[1];
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
function matchDistance() {
|
|
472
|
+
return match('%', tokens.percentageValue, 1) ||
|
|
473
|
+
matchPositionKeyword() ||
|
|
474
|
+
matchLength();
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function matchPositionKeyword() {
|
|
478
|
+
return match('position-keyword', tokens.positionKeywords, 1);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
function matchLength() {
|
|
482
|
+
return match('px', tokens.pixelValue, 1) ||
|
|
483
|
+
match('em', tokens.emValue, 1);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
function match(type, pattern, captureIndex) {
|
|
487
|
+
var captures = scan(pattern);
|
|
488
|
+
if (captures) {
|
|
489
|
+
return {
|
|
490
|
+
type: type,
|
|
491
|
+
value: captures[captureIndex]
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
function scan(regexp) {
|
|
497
|
+
var captures,
|
|
498
|
+
blankCaptures;
|
|
499
|
+
|
|
500
|
+
blankCaptures = /^[\n\r\t\s]+/.exec(input);
|
|
501
|
+
if (blankCaptures) {
|
|
502
|
+
consume(blankCaptures[0].length);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
captures = regexp.exec(input);
|
|
506
|
+
if (captures) {
|
|
507
|
+
consume(captures[0].length);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
return captures;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
function consume(size) {
|
|
514
|
+
input = input.substr(size);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
return function(code) {
|
|
518
|
+
input = code.toString();
|
|
519
|
+
return getAST();
|
|
520
|
+
};
|
|
521
|
+
})();
|
|
522
|
+
|
|
523
|
+
node.parse = GradientParser.parse;
|
|
524
|
+
node.stringify = GradientParser.stringify;
|
|
525
|
+
return node;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
export { requireNode as __require };
|