@zohodesk/components 1.0.0-alpha-236 → 1.0.0-alpha-239
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/README.md +19 -0
- package/assets/Appearance/dark/mode/darkMode.module.css +1 -1
- package/assets/Appearance/dark/themes/blue/blueDarkComponentTheme.module.css +1 -1
- package/assets/Appearance/default/mode/defaultMode.module.css +1 -1
- package/assets/Appearance/default/themes/blue/blueDefaultComponentTheme.module.css +1 -1
- package/assets/Appearance/pureDark/mode/pureDarkMode.module.css +358 -0
- package/assets/Appearance/pureDark/themes/blue/bluePureDarkCTATheme.module.css +34 -0
- package/assets/Appearance/pureDark/themes/blue/bluePureDarkComponentTheme.module.css +42 -0
- package/assets/Appearance/pureDark/themes/green/greenPureDarkCTATheme.module.css +34 -0
- package/assets/Appearance/pureDark/themes/green/greenPureDarkComponentTheme.module.css +42 -0
- package/assets/Appearance/pureDark/themes/orange/orangePureDarkCTATheme.module.css +34 -0
- package/assets/Appearance/pureDark/themes/orange/orangePureDarkComponentTheme.module.css +42 -0
- package/assets/Appearance/pureDark/themes/red/redPureDarkCTATheme.module.css +34 -0
- package/assets/Appearance/pureDark/themes/red/redPureDarkComponentTheme.module.css +42 -0
- package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkCTATheme.module.css +34 -0
- package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkComponentTheme.module.css +42 -0
- package/docs/external/active-line.js +72 -0
- package/docs/external/autorefresh.js +47 -0
- package/docs/external/codemirror.js +9681 -0
- package/docs/external/css/hopscotch.css +576 -0
- package/docs/external/css/styleGuide.css +1100 -0
- package/docs/external/css.js +466 -0
- package/docs/external/designTokens.js +1 -0
- package/docs/external/foldcode.js +152 -0
- package/docs/external/format.js +129 -0
- package/docs/external/htmlmixed.js +84 -0
- package/docs/external/images/bottom.png +0 -0
- package/docs/external/images/bottombg.jpg +0 -0
- package/docs/external/images/desk.png +0 -0
- package/docs/external/images/desklogo.png +0 -0
- package/docs/external/images/menu.png +0 -0
- package/docs/external/index.html +127 -0
- package/docs/external/javascript.js +422 -0
- package/docs/external/jsx.js +148 -0
- package/docs/external/matchbrackets.js +145 -0
- package/docs/external/xml.js +322 -0
- package/docs/package.json +41 -0
- package/docs/src/index.js +1311 -0
- package/es/Accordion/docs/Accordion__Demo.docs.js +80 -0
- package/es/Animation/docs/Animation__default.docs.js +34 -0
- package/es/Animation/docs/Animation__fadeIn.docs.js +34 -0
- package/es/Animation/docs/Animation__scaleIn.docs.js +34 -0
- package/es/Animation/docs/Animation__skewIn.docs.js +34 -0
- package/es/Animation/docs/Animation__slideDown.docs.js +34 -0
- package/es/Animation/docs/Animation__slideLeft.docs.js +34 -0
- package/es/Animation/docs/Animation__zoomIn.docs.js +34 -0
- package/es/AppContainer/AppContainer.js +6 -1
- package/es/AppContainer/docs/AppContainer__default.docs.js +20 -0
- package/es/Avatar/docs/Avatar__custom.docs.js +29 -0
- package/es/Avatar/docs/Avatar__default.docs.js +29 -0
- package/es/Avatar/docs/Avatar__palette.docs.js +49 -0
- package/es/Avatar/docs/Avatar__text.docs.js +28 -0
- package/es/AvatarTeam/docs/AvatarTeam__custom.docs.js +73 -0
- package/es/AvatarTeam/docs/AvatarTeam__default.docs.js +31 -0
- package/es/AvatarTeam/docs/AvatarTeam__palette.docs.js +50 -0
- package/es/AvatarTeam/docs/AvatarTeam__size.docs.js +49 -0
- package/es/Button/docs/Button__custom.docs.js +771 -0
- package/es/Button/docs/Button__default.docs.js +536 -0
- package/es/Buttongroup/docs/Buttongroup__custom.docs.js +37 -0
- package/es/Buttongroup/docs/Buttongroup__footer.docs.js +33 -0
- package/es/Buttongroup/docs/Buttongroup__header.docs.js +42 -0
- package/es/Card/docs/Card__Custom.docs.js +34 -0
- package/es/Card/docs/Card__Default.docs.js +37 -0
- package/es/Card/docs/Card__Scroll.docs.js +59 -0
- package/es/CheckBox/CheckBox.js +2 -1
- package/es/CheckBox/docs/CheckBox__custom.docs.js +293 -0
- package/es/CheckBox/docs/CheckBox__default.docs.js +219 -0
- package/es/DateTime/DateTime.js +8 -2
- package/es/DateTime/DateWidget.js +10 -2
- package/es/DateTime/docs/DateTime__default.docs.js +91 -0
- package/es/DateTime/docs/DateWidget__default.docs.js +183 -0
- package/es/DateTime/docs/timezonedata.json +1 -0
- package/es/DropBox/docs/DropBox__custom.docs.js +66 -0
- package/es/DropBox/docs/DropBox__customOrder.docs.js +92 -0
- package/es/DropBox/docs/DropBox__fixedPosition.docs.js +91 -0
- package/es/DropBox/docs/DropBox__position.docs.js +87 -0
- package/es/DropBox/docs/DropBox__size.docs.js +61 -0
- package/es/DropDown/docs/DropDownHeading__custom.docs.js +23 -0
- package/es/DropDown/docs/DropDownHeading__default.docs.js +21 -0
- package/es/Label/docs/Label__clipped.docs.js +27 -0
- package/es/Label/docs/Label__custom.docs.js +30 -0
- package/es/Label/docs/Label__palette.docs.js +42 -0
- package/es/Label/docs/Label__size.docs.js +29 -0
- package/es/Label/docs/Label__type.docs.js +37 -0
- package/es/Layout/docs/Layout__Hidden.docs.js +77 -0
- package/es/Layout/docs/Layout__default.docs.js +49 -0
- package/es/Layout/docs/Layout__four_Column.docs.js +85 -0
- package/es/Layout/docs/Layout__three_Column.docs.js +76 -0
- package/es/Layout/docs/Layout__two_Column.docs.js +69 -0
- package/es/LightNightMode/docs/AlternativeColors.docs.js +74 -0
- package/es/ListItem/ListItem.module.css +1 -1
- package/es/ListItem/docs/ListItemWithAvatar__custom.docs.js +155 -0
- package/es/ListItem/docs/ListItemWithAvatar__default.docs.js +112 -0
- package/es/ListItem/docs/ListItemWithCheckBox__custom.docs.js +91 -0
- package/es/ListItem/docs/ListItemWithCheckBox__default.docs.js +65 -0
- package/es/ListItem/docs/ListItemWithIcon__custom.docs.js +68 -0
- package/es/ListItem/docs/ListItemWithIcon__default.docs.js +62 -0
- package/es/ListItem/docs/ListItemWithRadio__custom.docs.js +91 -0
- package/es/ListItem/docs/ListItemWithRadio__default.docs.js +65 -0
- package/es/ListItem/docs/ListItem__custom.docs.js +114 -0
- package/es/ListItem/docs/ListItem__default.docs.js +82 -0
- package/es/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +125 -0
- package/es/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +114 -0
- package/es/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +141 -0
- package/es/MultiSelect/docs/MultiSelect__default.docs.js +161 -0
- package/es/PopOver/docs/PopOver__default.docs.js +32 -0
- package/es/Provider/Config.js +1 -2
- package/es/Provider/docs/Provider_Id__Class.docs.js +29 -0
- package/es/Provider/docs/Provider_Id__Function.docs.js +18 -0
- package/es/Provider/docs/Provider_Zindex__Class.docs.js +32 -0
- package/es/Provider/docs/Provider_Zindex__Function.docs.js +23 -0
- package/es/Provider.js +72 -35
- package/es/Radio/docs/Radio__custom.docs.js +245 -0
- package/es/Radio/docs/Radio__default.docs.js +169 -0
- package/es/Responsive/Responsive.js +1 -0
- package/es/Responsive/docs/Responsive__Custom.docs.js +206 -0
- package/es/Responsive/docs/Responsive__default.docs.js +97 -0
- package/es/Responsive/docs/style.module.css +56 -0
- package/es/Ribbon/docs/Ribbon__custom.docs.js +386 -0
- package/es/Ribbon/docs/Ribbon__default.docs.js +342 -0
- package/es/RippleEffect/docs/RippleEffect__default.docs.js +435 -0
- package/es/Select/SelectWithIcon.js +1 -0
- package/es/Select/docs/GroupSelect__default.docs.js +149 -0
- package/es/Select/docs/SelectWithAvatar__default.docs.js +97 -0
- package/es/Select/docs/SelectWithIcon__default.docs.js +138 -0
- package/es/Select/docs/Select__default.docs.js +288 -0
- package/es/Stencils/docs/Stencils__custom.docs.js +45 -0
- package/es/Stencils/docs/Stencils__default.docs.js +50 -0
- package/es/Switch/docs/Switch__custom.docs.js +153 -0
- package/es/Switch/docs/Switch__default.docs.js +107 -0
- package/es/Tab/docs/Tab__default.docs.js +258 -0
- package/es/Tab/docs/tabdocs.module.css +29 -0
- package/es/Tag/docs/Tag__custom.docs.js +368 -0
- package/es/Tag/docs/Tag__default.docs.js +323 -0
- package/es/TextBox/docs/TextBox__custom.docs.js +43 -0
- package/es/TextBox/docs/TextBox__default.docs.js +40 -0
- package/es/TextBox/docs/TextBox__size.docs.js +38 -0
- package/es/TextBox/docs/TextBox__variant.docs.js +38 -0
- package/es/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +89 -0
- package/es/TextBoxIcon/docs/TextBoxIcon__default.docs.js +61 -0
- package/es/Textarea/docs/Textarea__animated.docs.js +41 -0
- package/es/Textarea/docs/Textarea__custom.docs.js +82 -0
- package/es/Textarea/docs/Textarea__default.docs.js +76 -0
- package/es/Textarea/docs/Textarea__disabled.docs.js +29 -0
- package/es/Tooltip/Tooltip.js +40 -2
- package/es/Tooltip/docs/Tooltip__default.docs.js +371 -0
- package/es/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +97 -0
- package/es/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +150 -0
- package/es/a11y/FocusScope/docs/FocusScope__default.docs.js +139 -0
- package/es/beta/FocusRing/docs/FocusRing__default.docs.js +48 -0
- package/es/common/docStyle.module.css +6 -2
- package/es/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +72 -0
- package/es/semantic/Button/docs/Button__default.docs.js +20 -0
- package/lib/Accordion/docs/Accordion__Demo.docs.js +126 -0
- package/lib/Animation/docs/Animation__default.docs.js +85 -0
- package/lib/Animation/docs/Animation__fadeIn.docs.js +85 -0
- package/lib/Animation/docs/Animation__scaleIn.docs.js +85 -0
- package/lib/Animation/docs/Animation__skewIn.docs.js +85 -0
- package/lib/Animation/docs/Animation__slideDown.docs.js +85 -0
- package/lib/Animation/docs/Animation__slideLeft.docs.js +85 -0
- package/lib/Animation/docs/Animation__zoomIn.docs.js +85 -0
- package/lib/AppContainer/AppContainer.js +7 -0
- package/lib/AppContainer/docs/AppContainer__default.docs.js +70 -0
- package/lib/Avatar/docs/Avatar__custom.docs.js +87 -0
- package/lib/Avatar/docs/Avatar__default.docs.js +83 -0
- package/lib/Avatar/docs/Avatar__palette.docs.js +107 -0
- package/lib/Avatar/docs/Avatar__text.docs.js +86 -0
- package/lib/AvatarTeam/docs/AvatarTeam__custom.docs.js +124 -0
- package/lib/AvatarTeam/docs/AvatarTeam__default.docs.js +82 -0
- package/lib/AvatarTeam/docs/AvatarTeam__palette.docs.js +101 -0
- package/lib/AvatarTeam/docs/AvatarTeam__size.docs.js +100 -0
- package/lib/Button/docs/Button__custom.docs.js +826 -0
- package/lib/Button/docs/Button__default.docs.js +590 -0
- package/lib/Buttongroup/docs/Buttongroup__custom.docs.js +89 -0
- package/lib/Buttongroup/docs/Buttongroup__footer.docs.js +85 -0
- package/lib/Buttongroup/docs/Buttongroup__header.docs.js +98 -0
- package/lib/Card/docs/Card__Custom.docs.js +90 -0
- package/lib/Card/docs/Card__Default.docs.js +92 -0
- package/lib/Card/docs/Card__Scroll.docs.js +114 -0
- package/lib/CheckBox/CheckBox.js +2 -1
- package/lib/CheckBox/docs/CheckBox__custom.docs.js +348 -0
- package/lib/CheckBox/docs/CheckBox__default.docs.js +273 -0
- package/lib/DateTime/DateTime.js +8 -2
- package/lib/DateTime/DateWidget.js +10 -2
- package/lib/DateTime/docs/DateTime__default.docs.js +142 -0
- package/lib/DateTime/docs/DateWidget__default.docs.js +240 -0
- package/lib/DateTime/docs/timezonedata.json +1 -0
- package/lib/DropBox/docs/DropBox__custom.docs.js +122 -0
- package/lib/DropBox/docs/DropBox__customOrder.docs.js +141 -0
- package/lib/DropBox/docs/DropBox__fixedPosition.docs.js +140 -0
- package/lib/DropBox/docs/DropBox__position.docs.js +142 -0
- package/lib/DropBox/docs/DropBox__size.docs.js +116 -0
- package/lib/DropDown/docs/DropDownHeading__custom.docs.js +73 -0
- package/lib/DropDown/docs/DropDownHeading__default.docs.js +70 -0
- package/lib/Label/docs/Label__clipped.docs.js +81 -0
- package/lib/Label/docs/Label__custom.docs.js +85 -0
- package/lib/Label/docs/Label__palette.docs.js +96 -0
- package/lib/Label/docs/Label__size.docs.js +83 -0
- package/lib/Label/docs/Label__type.docs.js +91 -0
- package/lib/Layout/docs/Layout__Hidden.docs.js +127 -0
- package/lib/Layout/docs/Layout__default.docs.js +98 -0
- package/lib/Layout/docs/Layout__four_Column.docs.js +135 -0
- package/lib/Layout/docs/Layout__three_Column.docs.js +126 -0
- package/lib/Layout/docs/Layout__two_Column.docs.js +119 -0
- package/lib/LightNightMode/docs/AlternativeColors.docs.js +131 -0
- package/lib/ListItem/ListItem.module.css +1 -1
- package/lib/ListItem/docs/ListItemWithAvatar__custom.docs.js +206 -0
- package/lib/ListItem/docs/ListItemWithAvatar__default.docs.js +162 -0
- package/lib/ListItem/docs/ListItemWithCheckBox__custom.docs.js +142 -0
- package/lib/ListItem/docs/ListItemWithCheckBox__default.docs.js +115 -0
- package/lib/ListItem/docs/ListItemWithIcon__custom.docs.js +119 -0
- package/lib/ListItem/docs/ListItemWithIcon__default.docs.js +112 -0
- package/lib/ListItem/docs/ListItemWithRadio__custom.docs.js +142 -0
- package/lib/ListItem/docs/ListItemWithRadio__default.docs.js +115 -0
- package/lib/ListItem/docs/ListItem__custom.docs.js +164 -0
- package/lib/ListItem/docs/ListItem__default.docs.js +131 -0
- package/lib/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +177 -0
- package/lib/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +165 -0
- package/lib/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +191 -0
- package/lib/MultiSelect/docs/MultiSelect__default.docs.js +214 -0
- package/lib/PopOver/docs/PopOver__default.docs.js +86 -0
- package/lib/Provider/Config.js +1 -2
- package/lib/Provider/docs/Provider_Id__Class.docs.js +77 -0
- package/lib/Provider/docs/Provider_Id__Function.docs.js +29 -0
- package/lib/Provider/docs/Provider_Zindex__Class.docs.js +80 -0
- package/lib/Provider/docs/Provider_Zindex__Function.docs.js +34 -0
- package/lib/Provider.js +88 -37
- package/lib/Radio/docs/Radio__custom.docs.js +299 -0
- package/lib/Radio/docs/Radio__default.docs.js +222 -0
- package/lib/Responsive/docs/Responsive__Custom.docs.js +272 -0
- package/lib/Responsive/docs/Responsive__default.docs.js +142 -0
- package/lib/Responsive/docs/style.module.css +56 -0
- package/lib/Ribbon/docs/Ribbon__custom.docs.js +437 -0
- package/lib/Ribbon/docs/Ribbon__default.docs.js +392 -0
- package/lib/RippleEffect/docs/RippleEffect__default.docs.js +484 -0
- package/lib/Select/docs/GroupSelect__default.docs.js +199 -0
- package/lib/Select/docs/SelectWithAvatar__default.docs.js +152 -0
- package/lib/Select/docs/SelectWithIcon__default.docs.js +190 -0
- package/lib/Select/docs/Select__default.docs.js +340 -0
- package/lib/Stencils/docs/Stencils__custom.docs.js +96 -0
- package/lib/Stencils/docs/Stencils__default.docs.js +101 -0
- package/lib/Switch/docs/Switch__custom.docs.js +203 -0
- package/lib/Switch/docs/Switch__default.docs.js +156 -0
- package/lib/Tab/docs/Tab__default.docs.js +308 -0
- package/lib/Tab/docs/tabdocs.module.css +29 -0
- package/lib/Tag/docs/Tag__custom.docs.js +423 -0
- package/lib/Tag/docs/Tag__default.docs.js +377 -0
- package/lib/TextBox/docs/TextBox__custom.docs.js +98 -0
- package/lib/TextBox/docs/TextBox__default.docs.js +95 -0
- package/lib/TextBox/docs/TextBox__size.docs.js +93 -0
- package/lib/TextBox/docs/TextBox__variant.docs.js +93 -0
- package/lib/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +145 -0
- package/lib/TextBoxIcon/docs/TextBoxIcon__default.docs.js +117 -0
- package/lib/Textarea/docs/Textarea__animated.docs.js +95 -0
- package/lib/Textarea/docs/Textarea__custom.docs.js +137 -0
- package/lib/Textarea/docs/Textarea__default.docs.js +130 -0
- package/lib/Textarea/docs/Textarea__disabled.docs.js +83 -0
- package/lib/Tooltip/Tooltip.js +47 -2
- package/lib/Tooltip/docs/Tooltip__default.docs.js +430 -0
- package/lib/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +150 -0
- package/lib/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +206 -0
- package/lib/a11y/FocusScope/docs/FocusScope__default.docs.js +191 -0
- package/lib/beta/FocusRing/docs/FocusRing__default.docs.js +101 -0
- package/lib/common/docStyle.module.css +6 -2
- package/lib/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +145 -0
- package/lib/semantic/Button/docs/Button__default.docs.js +66 -0
- package/package.json +7 -6
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
|
3
|
+
|
|
4
|
+
(function(mod) {
|
|
5
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
6
|
+
mod(require("../../lib/codemirror"));
|
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
|
8
|
+
define(["../../lib/codemirror"], mod);
|
|
9
|
+
else // Plain browser env
|
|
10
|
+
mod(CodeMirror);
|
|
11
|
+
})(function(CodeMirror) {
|
|
12
|
+
var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
|
|
13
|
+
(document.documentMode == null || document.documentMode < 8);
|
|
14
|
+
|
|
15
|
+
var Pos = CodeMirror.Pos;
|
|
16
|
+
|
|
17
|
+
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
|
|
18
|
+
|
|
19
|
+
function findMatchingBracket(cm, where, config) {
|
|
20
|
+
var line = cm.getLineHandle(where.line), pos = where.ch - 1;
|
|
21
|
+
var afterCursor = config && config.afterCursor
|
|
22
|
+
if (afterCursor == null)
|
|
23
|
+
afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)
|
|
24
|
+
|
|
25
|
+
// A cursor is defined as between two characters, but in in vim command mode
|
|
26
|
+
// (i.e. not insert mode), the cursor is visually represented as a
|
|
27
|
+
// highlighted box on top of the 2nd character. Otherwise, we allow matches
|
|
28
|
+
// from before or after the cursor.
|
|
29
|
+
var match = (!afterCursor && pos >= 0 && matching[line.text.charAt(pos)]) ||
|
|
30
|
+
matching[line.text.charAt(++pos)];
|
|
31
|
+
if (!match) return null;
|
|
32
|
+
var dir = match.charAt(1) == ">" ? 1 : -1;
|
|
33
|
+
if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;
|
|
34
|
+
var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));
|
|
35
|
+
|
|
36
|
+
var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
|
|
37
|
+
if (found == null) return null;
|
|
38
|
+
return {from: Pos(where.line, pos), to: found && found.pos,
|
|
39
|
+
match: found && found.ch == match.charAt(0), forward: dir > 0};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// bracketRegex is used to specify which type of bracket to scan
|
|
43
|
+
// should be a regexp, e.g. /[[\]]/
|
|
44
|
+
//
|
|
45
|
+
// Note: If "where" is on an open bracket, then this bracket is ignored.
|
|
46
|
+
//
|
|
47
|
+
// Returns false when no bracket was found, null when it reached
|
|
48
|
+
// maxScanLines and gave up
|
|
49
|
+
function scanForBracket(cm, where, dir, style, config) {
|
|
50
|
+
var maxScanLen = (config && config.maxScanLineLength) || 10000;
|
|
51
|
+
var maxScanLines = (config && config.maxScanLines) || 1000;
|
|
52
|
+
|
|
53
|
+
var stack = [];
|
|
54
|
+
var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/;
|
|
55
|
+
var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
|
|
56
|
+
: Math.max(cm.firstLine() - 1, where.line - maxScanLines);
|
|
57
|
+
for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
|
|
58
|
+
var line = cm.getLine(lineNo);
|
|
59
|
+
if (!line) continue;
|
|
60
|
+
var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;
|
|
61
|
+
if (line.length > maxScanLen) continue;
|
|
62
|
+
if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);
|
|
63
|
+
for (; pos != end; pos += dir) {
|
|
64
|
+
var ch = line.charAt(pos);
|
|
65
|
+
if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
|
|
66
|
+
var match = matching[ch];
|
|
67
|
+
if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
|
|
68
|
+
else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
|
|
69
|
+
else stack.pop();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function matchBrackets(cm, autoclear, config) {
|
|
77
|
+
// Disable brace matching in long lines, since it'll cause hugely slow updates
|
|
78
|
+
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
|
|
79
|
+
var marks = [], ranges = cm.listSelections();
|
|
80
|
+
for (var i = 0; i < ranges.length; i++) {
|
|
81
|
+
var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);
|
|
82
|
+
if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
|
|
83
|
+
var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
|
|
84
|
+
marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
|
|
85
|
+
if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)
|
|
86
|
+
marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (marks.length) {
|
|
91
|
+
// Kludge to work around the IE bug from issue #1193, where text
|
|
92
|
+
// input stops going to the textare whever this fires.
|
|
93
|
+
if (ie_lt8 && cm.state.focused) cm.focus();
|
|
94
|
+
|
|
95
|
+
var clear = function() {
|
|
96
|
+
cm.operation(function() {
|
|
97
|
+
for (var i = 0; i < marks.length; i++) marks[i].clear();
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
if (autoclear) setTimeout(clear, 800);
|
|
101
|
+
else return clear;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function doMatchBrackets(cm) {
|
|
106
|
+
cm.operation(function() {
|
|
107
|
+
if (cm.state.matchBrackets.currentlyHighlighted) {
|
|
108
|
+
cm.state.matchBrackets.currentlyHighlighted();
|
|
109
|
+
cm.state.matchBrackets.currentlyHighlighted = null;
|
|
110
|
+
}
|
|
111
|
+
cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
|
|
116
|
+
if (old && old != CodeMirror.Init) {
|
|
117
|
+
cm.off("cursorActivity", doMatchBrackets);
|
|
118
|
+
if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {
|
|
119
|
+
cm.state.matchBrackets.currentlyHighlighted();
|
|
120
|
+
cm.state.matchBrackets.currentlyHighlighted = null;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (val) {
|
|
124
|
+
cm.state.matchBrackets = typeof val == "object" ? val : {};
|
|
125
|
+
cm.on("cursorActivity", doMatchBrackets);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
|
|
130
|
+
CodeMirror.defineExtension("findMatchingBracket", function(pos, config, oldConfig){
|
|
131
|
+
// Backwards-compatibility kludge
|
|
132
|
+
if (oldConfig || typeof config == "boolean") {
|
|
133
|
+
if (!oldConfig) {
|
|
134
|
+
config = config ? {strict: true} : null
|
|
135
|
+
} else {
|
|
136
|
+
oldConfig.strict = config
|
|
137
|
+
config = oldConfig
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return findMatchingBracket(this, pos, config)
|
|
141
|
+
});
|
|
142
|
+
CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){
|
|
143
|
+
return scanForBracket(this, pos, dir, style, config);
|
|
144
|
+
});
|
|
145
|
+
});
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|
2
|
+
var indentUnit = config.indentUnit;
|
|
3
|
+
var Kludges = parserConfig.htmlMode ? {
|
|
4
|
+
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
|
|
5
|
+
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
|
|
6
|
+
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
|
|
7
|
+
'track': true, 'wbr': true},
|
|
8
|
+
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
|
|
9
|
+
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
|
|
10
|
+
'th': true, 'tr': true},
|
|
11
|
+
contextGrabbers: {
|
|
12
|
+
'dd': {'dd': true, 'dt': true},
|
|
13
|
+
'dt': {'dd': true, 'dt': true},
|
|
14
|
+
'li': {'li': true},
|
|
15
|
+
'option': {'option': true, 'optgroup': true},
|
|
16
|
+
'optgroup': {'optgroup': true},
|
|
17
|
+
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
|
|
18
|
+
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
|
|
19
|
+
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
|
|
20
|
+
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
|
|
21
|
+
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
|
|
22
|
+
'rp': {'rp': true, 'rt': true},
|
|
23
|
+
'rt': {'rp': true, 'rt': true},
|
|
24
|
+
'tbody': {'tbody': true, 'tfoot': true},
|
|
25
|
+
'td': {'td': true, 'th': true},
|
|
26
|
+
'tfoot': {'tbody': true},
|
|
27
|
+
'th': {'td': true, 'th': true},
|
|
28
|
+
'thead': {'tbody': true, 'tfoot': true},
|
|
29
|
+
'tr': {'tr': true}
|
|
30
|
+
},
|
|
31
|
+
doNotIndent: {"pre": true},
|
|
32
|
+
allowUnquoted: true,
|
|
33
|
+
allowMissing: true
|
|
34
|
+
} : {
|
|
35
|
+
autoSelfClosers: {},
|
|
36
|
+
implicitlyClosed: {},
|
|
37
|
+
contextGrabbers: {},
|
|
38
|
+
doNotIndent: {},
|
|
39
|
+
allowUnquoted: false,
|
|
40
|
+
allowMissing: false
|
|
41
|
+
};
|
|
42
|
+
var alignCDATA = parserConfig.alignCDATA;
|
|
43
|
+
|
|
44
|
+
// Return variables for tokenizers
|
|
45
|
+
var tagName, type;
|
|
46
|
+
|
|
47
|
+
function inText(stream, state) {
|
|
48
|
+
function chain(parser) {
|
|
49
|
+
state.tokenize = parser;
|
|
50
|
+
return parser(stream, state);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
var ch = stream.next();
|
|
54
|
+
if (ch == "<") {
|
|
55
|
+
if (stream.eat("!")) {
|
|
56
|
+
if (stream.eat("[")) {
|
|
57
|
+
if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
|
|
58
|
+
else return null;
|
|
59
|
+
}
|
|
60
|
+
else if (stream.match("--")) return chain(inBlock("comment", "-->"));
|
|
61
|
+
else if (stream.match("DOCTYPE", true, true)) {
|
|
62
|
+
stream.eatWhile(/[\w\._\-]/);
|
|
63
|
+
return chain(doctype(1));
|
|
64
|
+
}
|
|
65
|
+
else return null;
|
|
66
|
+
}
|
|
67
|
+
else if (stream.eat("?")) {
|
|
68
|
+
stream.eatWhile(/[\w\._\-]/);
|
|
69
|
+
state.tokenize = inBlock("meta", "?>");
|
|
70
|
+
return "meta";
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
var isClose = stream.eat("/");
|
|
74
|
+
tagName = "";
|
|
75
|
+
var c;
|
|
76
|
+
while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c;
|
|
77
|
+
if (!tagName) return "error";
|
|
78
|
+
type = isClose ? "closeTag" : "openTag";
|
|
79
|
+
state.tokenize = inTag;
|
|
80
|
+
return "tag";
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else if (ch == "&") {
|
|
84
|
+
var ok;
|
|
85
|
+
if (stream.eat("#")) {
|
|
86
|
+
if (stream.eat("x")) {
|
|
87
|
+
ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
|
|
88
|
+
} else {
|
|
89
|
+
ok = stream.eatWhile(/[\d]/) && stream.eat(";");
|
|
90
|
+
}
|
|
91
|
+
} else {
|
|
92
|
+
ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
|
|
93
|
+
}
|
|
94
|
+
return ok ? "atom" : "error";
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
stream.eatWhile(/[^&<]/);
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function inTag(stream, state) {
|
|
103
|
+
var ch = stream.next();
|
|
104
|
+
if (ch == ">" || (ch == "/" && stream.eat(">"))) {
|
|
105
|
+
state.tokenize = inText;
|
|
106
|
+
type = ch == ">" ? "endTag" : "selfcloseTag";
|
|
107
|
+
return "tag";
|
|
108
|
+
}
|
|
109
|
+
else if (ch == "=") {
|
|
110
|
+
type = "equals";
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
else if (/[\'\"]/.test(ch)) {
|
|
114
|
+
state.tokenize = inAttribute(ch);
|
|
115
|
+
return state.tokenize(stream, state);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
stream.eatWhile(/[^\s\u00a0=<>\"\']/);
|
|
119
|
+
return "word";
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function inAttribute(quote) {
|
|
124
|
+
return function(stream, state) {
|
|
125
|
+
while (!stream.eol()) {
|
|
126
|
+
if (stream.next() == quote) {
|
|
127
|
+
state.tokenize = inTag;
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return "string";
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function inBlock(style, terminator) {
|
|
136
|
+
return function(stream, state) {
|
|
137
|
+
while (!stream.eol()) {
|
|
138
|
+
if (stream.match(terminator)) {
|
|
139
|
+
state.tokenize = inText;
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
stream.next();
|
|
143
|
+
}
|
|
144
|
+
return style;
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
function doctype(depth) {
|
|
148
|
+
return function(stream, state) {
|
|
149
|
+
var ch;
|
|
150
|
+
while ((ch = stream.next()) != null) {
|
|
151
|
+
if (ch == "<") {
|
|
152
|
+
state.tokenize = doctype(depth + 1);
|
|
153
|
+
return state.tokenize(stream, state);
|
|
154
|
+
} else if (ch == ">") {
|
|
155
|
+
if (depth == 1) {
|
|
156
|
+
state.tokenize = inText;
|
|
157
|
+
break;
|
|
158
|
+
} else {
|
|
159
|
+
state.tokenize = doctype(depth - 1);
|
|
160
|
+
return state.tokenize(stream, state);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return "meta";
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
var curState, setStyle;
|
|
169
|
+
function pass() {
|
|
170
|
+
for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]);
|
|
171
|
+
}
|
|
172
|
+
function cont() {
|
|
173
|
+
pass.apply(null, arguments);
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function pushContext(tagName, startOfLine) {
|
|
178
|
+
var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent);
|
|
179
|
+
curState.context = {
|
|
180
|
+
prev: curState.context,
|
|
181
|
+
tagName: tagName,
|
|
182
|
+
indent: curState.indented,
|
|
183
|
+
startOfLine: startOfLine,
|
|
184
|
+
noIndent: noIndent
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
function popContext() {
|
|
188
|
+
if (curState.context) curState.context = curState.context.prev;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function element(type) {
|
|
192
|
+
if (type == "openTag") {
|
|
193
|
+
curState.tagName = tagName;
|
|
194
|
+
return cont(attributes, endtag(curState.startOfLine));
|
|
195
|
+
} else if (type == "closeTag") {
|
|
196
|
+
var err = false;
|
|
197
|
+
if (curState.context) {
|
|
198
|
+
if (curState.context.tagName != tagName) {
|
|
199
|
+
if (Kludges.implicitlyClosed.hasOwnProperty(curState.context.tagName.toLowerCase())) {
|
|
200
|
+
popContext();
|
|
201
|
+
}
|
|
202
|
+
err = !curState.context || curState.context.tagName != tagName;
|
|
203
|
+
}
|
|
204
|
+
} else {
|
|
205
|
+
err = true;
|
|
206
|
+
}
|
|
207
|
+
if (err) setStyle = "error";
|
|
208
|
+
return cont(endclosetag(err));
|
|
209
|
+
}
|
|
210
|
+
return cont();
|
|
211
|
+
}
|
|
212
|
+
function endtag(startOfLine) {
|
|
213
|
+
return function(type) {
|
|
214
|
+
if (type == "selfcloseTag" ||
|
|
215
|
+
(type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(curState.tagName.toLowerCase()))) {
|
|
216
|
+
maybePopContext(curState.tagName.toLowerCase());
|
|
217
|
+
return cont();
|
|
218
|
+
}
|
|
219
|
+
if (type == "endTag") {
|
|
220
|
+
maybePopContext(curState.tagName.toLowerCase());
|
|
221
|
+
pushContext(curState.tagName, startOfLine);
|
|
222
|
+
return cont();
|
|
223
|
+
}
|
|
224
|
+
return cont();
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function endclosetag(err) {
|
|
228
|
+
return function(type) {
|
|
229
|
+
if (err) setStyle = "error";
|
|
230
|
+
if (type == "endTag") { popContext(); return cont(); }
|
|
231
|
+
setStyle = "error";
|
|
232
|
+
return cont(arguments.callee);
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function maybePopContext(nextTagName) {
|
|
236
|
+
var parentTagName;
|
|
237
|
+
while (true) {
|
|
238
|
+
if (!curState.context) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
parentTagName = curState.context.tagName.toLowerCase();
|
|
242
|
+
if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||
|
|
243
|
+
!Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
popContext();
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function attributes(type) {
|
|
251
|
+
if (type == "word") {setStyle = "attribute"; return cont(attribute, attributes);}
|
|
252
|
+
if (type == "endTag" || type == "selfcloseTag") return pass();
|
|
253
|
+
setStyle = "error";
|
|
254
|
+
return cont(attributes);
|
|
255
|
+
}
|
|
256
|
+
function attribute(type) {
|
|
257
|
+
if (type == "equals") return cont(attvalue, attributes);
|
|
258
|
+
if (!Kludges.allowMissing) setStyle = "error";
|
|
259
|
+
else if (type == "word") setStyle = "attribute";
|
|
260
|
+
return (type == "endTag" || type == "selfcloseTag") ? pass() : cont();
|
|
261
|
+
}
|
|
262
|
+
function attvalue(type) {
|
|
263
|
+
if (type == "string") return cont(attvaluemaybe);
|
|
264
|
+
if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return cont();}
|
|
265
|
+
setStyle = "error";
|
|
266
|
+
return (type == "endTag" || type == "selfCloseTag") ? pass() : cont();
|
|
267
|
+
}
|
|
268
|
+
function attvaluemaybe(type) {
|
|
269
|
+
if (type == "string") return cont(attvaluemaybe);
|
|
270
|
+
else return pass();
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
return {
|
|
274
|
+
startState: function() {
|
|
275
|
+
return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, context: null};
|
|
276
|
+
},
|
|
277
|
+
|
|
278
|
+
token: function(stream, state) {
|
|
279
|
+
if (stream.sol()) {
|
|
280
|
+
state.startOfLine = true;
|
|
281
|
+
state.indented = stream.indentation();
|
|
282
|
+
}
|
|
283
|
+
if (stream.eatSpace()) return null;
|
|
284
|
+
|
|
285
|
+
setStyle = type = tagName = null;
|
|
286
|
+
var style = state.tokenize(stream, state);
|
|
287
|
+
state.type = type;
|
|
288
|
+
if ((style || type) && style != "comment") {
|
|
289
|
+
curState = state;
|
|
290
|
+
while (true) {
|
|
291
|
+
var comb = state.cc.pop() || element;
|
|
292
|
+
if (comb(type || style)) break;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
state.startOfLine = false;
|
|
296
|
+
return setStyle || style;
|
|
297
|
+
},
|
|
298
|
+
|
|
299
|
+
indent: function(state, textAfter, fullLine) {
|
|
300
|
+
var context = state.context;
|
|
301
|
+
if ((state.tokenize != inTag && state.tokenize != inText) ||
|
|
302
|
+
context && context.noIndent)
|
|
303
|
+
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
|
|
304
|
+
if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
|
|
305
|
+
if (context && /^<\//.test(textAfter))
|
|
306
|
+
context = context.prev;
|
|
307
|
+
while (context && !context.startOfLine)
|
|
308
|
+
context = context.prev;
|
|
309
|
+
if (context) return context.indent + indentUnit;
|
|
310
|
+
else return 0;
|
|
311
|
+
},
|
|
312
|
+
|
|
313
|
+
electricChars: "/",
|
|
314
|
+
|
|
315
|
+
configuration: parserConfig.htmlMode ? "html" : "xml"
|
|
316
|
+
};
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
CodeMirror.defineMIME("text/xml", "xml");
|
|
320
|
+
CodeMirror.defineMIME("application/xml", "xml");
|
|
321
|
+
if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
|
|
322
|
+
CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "library",
|
|
3
|
+
"umdVar": "Library",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "",
|
|
6
|
+
"main": "lib/index",
|
|
7
|
+
"module": "es/index.js",
|
|
8
|
+
"jsnext:main": "es/index.js",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/vimalceg/fz-dnd.git"
|
|
12
|
+
},
|
|
13
|
+
"author": "",
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/vimalceg/fz-dnd/issues"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/vimalceg/fz-dnd#readme",
|
|
19
|
+
"scripts": {
|
|
20
|
+
"clean": "react-cli clean lib coverage",
|
|
21
|
+
"build:umd": "react-cli build:component:umd",
|
|
22
|
+
"lint": "react-cli lint"
|
|
23
|
+
},
|
|
24
|
+
"tags": [
|
|
25
|
+
"react",
|
|
26
|
+
"redux"
|
|
27
|
+
],
|
|
28
|
+
"keywords": [
|
|
29
|
+
"react",
|
|
30
|
+
"redux",
|
|
31
|
+
"router"
|
|
32
|
+
],
|
|
33
|
+
"react-cli": {
|
|
34
|
+
"umd": {
|
|
35
|
+
"component": {
|
|
36
|
+
"outputFolder":"external/js",
|
|
37
|
+
"watch":"true"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|