@zohodesk/components 1.0.0-alpha-263 → 1.0.0-alpha-264

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.
Files changed (53) hide show
  1. package/README.md +5 -0
  2. package/css_error.log +1 -0
  3. package/es/DropBox/DropBox.js +69 -243
  4. package/es/DropBox/DropBoxElement/DropBoxElement.js +118 -0
  5. package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +432 -0
  6. package/es/DropBox/DropBoxElement/css/cssJSLogic.js +89 -0
  7. package/es/DropBox/DropBoxElement/props/defaultProps.js +18 -0
  8. package/es/DropBox/DropBoxElement/props/propTypes.js +45 -0
  9. package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +51 -0
  10. package/es/DropBox/css/DropBox.module.css +59 -0
  11. package/es/DropBox/css/cssJSLogic.js +14 -0
  12. package/es/DropBox/props/defaultProps.js +9 -17
  13. package/es/DropBox/props/propTypes.js +9 -43
  14. package/es/css.js +2 -1
  15. package/es/utils/css/mergeStyle.js +2 -1
  16. package/lib/DropBox/DropBox.js +67 -276
  17. package/lib/DropBox/DropBoxElement/DropBoxElement.js +117 -0
  18. package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +432 -0
  19. package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +72 -0
  20. package/lib/DropBox/DropBoxElement/props/defaultProps.js +25 -0
  21. package/lib/DropBox/DropBoxElement/props/propTypes.js +53 -0
  22. package/lib/DropBox/DropBoxElement/useDropboxPosCalc.js +55 -0
  23. package/lib/DropBox/css/DropBox.module.css +59 -0
  24. package/lib/DropBox/css/cssJSLogic.js +18 -0
  25. package/lib/DropBox/props/defaultProps.js +15 -19
  26. package/lib/DropBox/props/propTypes.js +15 -45
  27. package/lib/css.js +2 -1
  28. package/lib/utils/css/mergeStyle.js +2 -1
  29. package/package.json +1 -1
  30. package/docs/external/active-line.js +0 -72
  31. package/docs/external/autorefresh.js +0 -47
  32. package/docs/external/codemirror.js +0 -9681
  33. package/docs/external/css/hopscotch.css +0 -576
  34. package/docs/external/css/styleGuide.css +0 -1100
  35. package/docs/external/css.js +0 -466
  36. package/docs/external/designTokens.js +0 -1
  37. package/docs/external/foldcode.js +0 -152
  38. package/docs/external/format.js +0 -129
  39. package/docs/external/htmlmixed.js +0 -84
  40. package/docs/external/images/bottom.png +0 -0
  41. package/docs/external/images/bottombg.jpg +0 -0
  42. package/docs/external/images/desk.png +0 -0
  43. package/docs/external/images/desklogo.png +0 -0
  44. package/docs/external/images/menu.png +0 -0
  45. package/docs/external/index.html +0 -127
  46. package/docs/external/javascript.js +0 -422
  47. package/docs/external/jsx.js +0 -148
  48. package/docs/external/matchbrackets.js +0 -145
  49. package/docs/external/xml.js +0 -322
  50. package/docs/package.json +0 -41
  51. package/docs/src/index.js +0 -1311
  52. package/es/DropBox/DropBox.module.css +0 -405
  53. package/lib/DropBox/DropBox.module.css +0 -405
@@ -1,129 +0,0 @@
1
- (function() {
2
- CodeMirror.extendMode('css', {
3
- commentStart: '/*',
4
- commentEnd: '*/',
5
- newlineAfterToken: function(type, content) {
6
- return /^[;{}]$/.test(content);
7
- }
8
- });
9
-
10
- CodeMirror.extendMode('javascript', {
11
- commentStart: '/*',
12
- commentEnd: '*/',
13
- // FIXME semicolons inside of for
14
- newlineAfterToken: function(type, content, textAfter, state) {
15
- if (this.jsonMode) {
16
- return /^[\[,{]$/.test(content) || /^}/.test(textAfter);
17
- } else {
18
- if (content == ';' && state.lexical && state.lexical.type == ')')
19
- return false;
20
- return /^[;{}]$/.test(content) && !/^;/.test(textAfter);
21
- }
22
- }
23
- });
24
-
25
- CodeMirror.extendMode('xml', {
26
- commentStart: '<!--',
27
- commentEnd: '-->',
28
- newlineAfterToken: function(type, content, textAfter) {
29
- return (type == 'tag' && />$/.test(content)) || /^</.test(textAfter);
30
- }
31
- });
32
-
33
- // Comment/uncomment the specified range
34
- CodeMirror.defineExtension('commentRange', function(isComment, from, to) {
35
- var cm = this,
36
- curMode = CodeMirror.innerMode(cm.getMode(), cm.getTokenAt(from).state)
37
- .mode;
38
- cm.operation(function() {
39
- if (isComment) {
40
- // Comment range
41
- cm.replaceRange(curMode.commentEnd, to);
42
- cm.replaceRange(curMode.commentStart, from);
43
- if (from.line == to.line && from.ch == to.ch)
44
- // An empty comment inserted - put cursor inside
45
- cm.setCursor(from.line, from.ch + curMode.commentStart.length);
46
- } else {
47
- // Uncomment range
48
- var selText = cm.getRange(from, to);
49
- var startIndex = selText.indexOf(curMode.commentStart);
50
- var endIndex = selText.lastIndexOf(curMode.commentEnd);
51
- if (startIndex > -1 && endIndex > -1 && endIndex > startIndex) {
52
- // Take string till comment start
53
- selText =
54
- selText.substr(0, startIndex) +
55
- // From comment start till comment end
56
- selText.substring(
57
- startIndex + curMode.commentStart.length,
58
- endIndex
59
- ) +
60
- // From comment end till string end
61
- selText.substr(endIndex + curMode.commentEnd.length);
62
- }
63
- cm.replaceRange(selText, from, to);
64
- }
65
- });
66
- });
67
-
68
- // Applies automatic mode-aware indentation to the specified range
69
- CodeMirror.defineExtension('autoIndentRange', function(from, to) {
70
- var cmInstance = this;
71
- this.operation(function() {
72
- for (var i = from.line; i <= to.line; i++) {
73
- cmInstance.indentLine(i, 'smart');
74
- }
75
- });
76
- });
77
-
78
- // Applies automatic formatting to the specified range
79
- CodeMirror.defineExtension('autoFormatRange', function(from, to) {
80
- var cm = this;
81
- var outer = cm.getMode(),
82
- text = cm.getRange(from, to).split('\n');
83
- var state = CodeMirror.copyState(outer, cm.getTokenAt(from).state);
84
- var tabSize = cm.getOption('tabSize');
85
-
86
- var out = '',
87
- lines = 0,
88
- atSol = from.ch == 0;
89
- function newline() {
90
- out += '\n';
91
- atSol = true;
92
- ++lines;
93
- }
94
-
95
- for (var i = 0; i < text.length; ++i) {
96
- var stream = new CodeMirror.StringStream(text[i], tabSize);
97
- while (!stream.eol()) {
98
- var inner = CodeMirror.innerMode(outer, state);
99
- var style = outer.token(stream, state),
100
- cur = stream.current();
101
- stream.start = stream.pos;
102
- if (!atSol || /\S/.test(cur)) {
103
- out += cur;
104
- atSol = false;
105
- }
106
- if (
107
- !atSol &&
108
- inner.mode.newlineAfterToken &&
109
- inner.mode.newlineAfterToken(
110
- style,
111
- cur,
112
- stream.string.slice(stream.pos) || text[i + 1] || '',
113
- inner.state
114
- )
115
- )
116
- newline();
117
- }
118
- if (!stream.pos && outer.blankLine) outer.blankLine(state);
119
- if (!atSol) newline();
120
- }
121
-
122
- cm.operation(function() {
123
- cm.replaceRange(out, from, to);
124
- for (var cur = from.line + 1, end = from.line + lines; cur <= end; ++cur)
125
- cm.indentLine(cur, 'smart');
126
- cm.setSelection(from, cm.getCursor(false));
127
- });
128
- });
129
- })();
@@ -1,84 +0,0 @@
1
- CodeMirror.defineMode("htmlmixed", function(config) {
2
- var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true});
3
- var jsMode = CodeMirror.getMode(config, "javascript");
4
- var cssMode = CodeMirror.getMode(config, "css");
5
-
6
- function html(stream, state) {
7
- var style = htmlMode.token(stream, state.htmlState);
8
- if (/(?:^|\s)tag(?:\s|$)/.test(style) && stream.current() == ">" && state.htmlState.context) {
9
- if (/^script$/i.test(state.htmlState.context.tagName)) {
10
- state.token = javascript;
11
- state.localState = jsMode.startState(htmlMode.indent(state.htmlState, ""));
12
- }
13
- else if (/^style$/i.test(state.htmlState.context.tagName)) {
14
- state.token = css;
15
- state.localState = cssMode.startState(htmlMode.indent(state.htmlState, ""));
16
- }
17
- }
18
- return style;
19
- }
20
- function maybeBackup(stream, pat, style) {
21
- var cur = stream.current();
22
- var close = cur.search(pat), m;
23
- if (close > -1) stream.backUp(cur.length - close);
24
- else if (m = cur.match(/<\/?$/)) {
25
- stream.backUp(cur.length);
26
- if (!stream.match(pat, false)) stream.match(cur[0]);
27
- }
28
- return style;
29
- }
30
- function javascript(stream, state) {
31
- if (stream.match(/^<\/\s*script\s*>/i, false)) {
32
- state.token = html;
33
- state.localState = null;
34
- return html(stream, state);
35
- }
36
- return maybeBackup(stream, /<\/\s*script\s*>/,
37
- jsMode.token(stream, state.localState));
38
- }
39
- function css(stream, state) {
40
- if (stream.match(/^<\/\s*style\s*>/i, false)) {
41
- state.token = html;
42
- state.localState = null;
43
- return html(stream, state);
44
- }
45
- return maybeBackup(stream, /<\/\s*style\s*>/,
46
- cssMode.token(stream, state.localState));
47
- }
48
-
49
- return {
50
- startState: function() {
51
- var state = htmlMode.startState();
52
- return {token: html, localState: null, mode: "html", htmlState: state};
53
- },
54
-
55
- copyState: function(state) {
56
- if (state.localState)
57
- var local = CodeMirror.copyState(state.token == css ? cssMode : jsMode, state.localState);
58
- return {token: state.token, localState: local, mode: state.mode,
59
- htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
60
- },
61
-
62
- token: function(stream, state) {
63
- return state.token(stream, state);
64
- },
65
-
66
- indent: function(state, textAfter) {
67
- if (state.token == html || /^\s*<\//.test(textAfter))
68
- return htmlMode.indent(state.htmlState, textAfter);
69
- else if (state.token == javascript)
70
- return jsMode.indent(state.localState, textAfter);
71
- else
72
- return cssMode.indent(state.localState, textAfter);
73
- },
74
-
75
- electricChars: "/{}:",
76
-
77
- innerMode: function(state) {
78
- var mode = state.token == html ? htmlMode : state.token == javascript ? jsMode : cssMode;
79
- return {state: state.localState || state.htmlState, mode: mode};
80
- }
81
- };
82
- }, "xml", "javascript", "css");
83
-
84
- CodeMirror.defineMIME("text/html", "htmlmixed");
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,127 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
-
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <link href="./images/desklogo.png" type="IMAGE/X-ICON" rel="SHORTCUT ICON">
7
-
8
- <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
9
- <title>Zoho Desk - Style Quide</title>
10
- <link rel="stylesheet" type="text/css" href="/docs/css/main.css">
11
-
12
- <script src="./codemirror.js"></script>
13
- <script src="./autorefresh.js"></script>
14
- <script src="./xml.js"></script>
15
- <script src="./htmlmixed.js"></script>
16
- <script src="./jsx.js"></script>
17
- <script src="./format.js"></script>
18
- <script src="./active-line.js"></script>
19
- <script src="./matchbrackets.js"></script>
20
- <script src="https://cdn.jsdelivr.net/npm/prettier@1.16.4/standalone.js"></script>
21
- <script src="https://cdn.jsdelivr.net/npm/prettier@1.16.4/parser-html.js"></script>
22
-
23
-
24
- <script src="./designTokens.js"></script>
25
- <script src='/docs/js/vendor.js'></script>
26
- <script src='/docs/js/main.js'></script>
27
- <link rel="stylesheet" type="text/css" href="./css/styleGuide.css">
28
- <link rel='manifest' href='/docs/js/manifest.json'>
29
-
30
- <meta name="apple-mobile-web-app-capable" content="yes">
31
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
32
- <meta name="apple-mobile-web-app-title" content="Zoho Desk Components">
33
-
34
- <link rel="stylesheet" type="text/css" href="./css/hopscotch.css">
35
-
36
-
37
-
38
- <script>
39
- function process(str) {
40
- var div = document.createElement('div');
41
- div.innerHTML = str.trim();
42
-
43
- return format(div, 0).innerHTML;
44
- }
45
-
46
- function format(node, level) {
47
- var indentBefore = new Array(level++ + 1).join(' '),
48
- indentAfter = new Array(level - 1).join(' '),
49
- textNode;
50
-
51
- for (var i = 0; i < node.children.length; i++) {
52
- textNode = document.createTextNode('\n' + indentBefore);
53
- node.insertBefore(textNode, node.children[i]);
54
-
55
- format(node.children[i], level);
56
-
57
- if (node.lastElementChild == node.children[i]) {
58
- textNode = document.createTextNode('\n' + indentAfter);
59
- node.appendChild(textNode);
60
- }
61
- }
62
- return node;
63
- }
64
-
65
- function selectText(containerid) {
66
- if (document.selection) {
67
- // IE
68
- var range = document.body.createTextRange();
69
- range.moveToElementText(document.getElementById(containerid));
70
- range.select();
71
- document.execCommand('copy');
72
- } else if (window.getSelection) {
73
- var range = document.createRange();
74
- range.selectNode(document.getElementById(containerid));
75
- window.getSelection().removeAllRanges();
76
- window.getSelection().addRange(range);
77
- document.execCommand('copy');
78
- }
79
- }
80
- </script>
81
-
82
- </head>
83
- <body>
84
- <div class='hideSVG'>
85
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
86
- <defs>
87
- <symbol id="icon-search" viewBox="0 0 32 32">
88
- <path d="M31.008 27.231l-7.58-6.447c-0.784-0.705-1.622-1.029-2.299-0.998 1.789-2.096 2.87-4.815 2.87-7.787 0-6.627-5.373-12-12-12s-12 5.373-12 12 5.373 12 12 12c2.972 0 5.691-1.081 7.787-2.87-0.031 0.677 0.293 1.515 0.998 2.299l6.447 7.58c1.104 1.226 2.907 1.33 4.007 0.23s0.997-2.903-0.23-4.007zM12 20c-4.418 0-8-3.582-8-8s3.582-8 8-8 8 3.582 8 8-3.582 8-8 8z"></path>
89
- </symbol>
90
- <defs>
91
- <symbol id="icon-copy" viewBox="0 0 500 500">
92
- <path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124
93
- C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124
94
- c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/>
95
- <path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227
96
- c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6
97
- V38.6C439.65,17.3,422.35,0,401.05,0z"/>
98
- </symbol>
99
- <symbol id="icon-desk" viewBox="0 0 24 32" >
100
- <path d="M23.7,3.8l-4,22.1c-0.3,1.4-1.4,2.4-2.9,2.4H4.6c-0.2,0-0.5,0.2-0.6,0.2l-3.4,2.7c-0.3,0.2-0.6,0-0.6-0.3l3.5-18.7
101
- C3.8,10.9,5,9.8,6.4,9.8h7.5c0.6,0,1.1,0.5,1,1.1l-0.3,1.8c0,0.5-0.5,0.8-1,0.8H7.8c-0.5,0-1,0.3-1,0.8l-1.6,9.3
102
- c-0.2,0.6,0.3,1.1,1,1.1h9.3c0.5,0,1-0.3,1-0.8l3-16.6c0.2-0.6-0.3-1.1-1-1.1h-1.4c-0.6,0-1.1-0.5-1-1.1l0.6-3.5
103
- c0.2-0.5,0.5-0.8,1-0.8H21C22.6,0.5,24,2.1,23.7,3.8z"/>
104
- </symbol>
105
- <symbol id="icon-rtl" viewBox="0 0 1000 1000" >
106
- <g transform="matrix(1 0 0 -1 0 1638)">
107
- <path d="M809.6,1628H371.3c-28.6,0-55.3-5.4-80.4-16.1c-25-10.7-46.9-25.5-65.5-44.3c-18.6-18.8-33.4-40.7-44.3-65.8s-16.4-51.6-16.4-79.9c0-28.6,5.5-55.3,16.4-80.4c10.9-25,25.7-46.9,44.3-65.8s40.5-33.6,65.5-44.3c25-10.7,51.8-16.1,80.4-16.1h51.4V983.1c0-7.1,2.5-13.1,7.6-18.1s11.1-7.6,18.1-7.6c7.4,0,13.6,2.5,18.6,7.6c5,5,7.6,11.1,7.6,18.1v593.5h154.7V983.1c0-7.1,2.5-13.1,7.6-18.1s11.1-7.6,18.1-7.6c7.1,0,13.1,2.5,18.1,7.6s7.6,11.1,7.6,18.1v593.5h129c7.1,0,13.1,2.5,18.1,7.6s7.6,11.1,7.6,18.1c0,7.1-2.5,13.1-7.6,18.1S816.7,1628,809.6,1628L809.6,1628z M422.7,1266.7h-51.4c-21.5,0-41.7,4.1-60.5,12.3c-18.8,8.2-35.2,19.3-49.1,33.3c-13.9,13.9-24.9,30.3-33,49.1c-8.1,18.8-12.1,39-12.1,60.5c0,21.2,4,41.1,12.1,60c8.1,18.8,19.1,35.2,33,49.1c13.9,13.9,30.3,25,49.1,33.3c18.8,8.2,39,12.3,60.5,12.3h51.4V1266.7L422.7,1266.7z M758.2,802.7H278.6l59.5,59c5,5,7.6,11.2,7.6,18.4c0,7.2-2.5,13.4-7.6,18.4c-5,5-11.2,7.6-18.4,7.6c-7.2,0-13.4-2.5-18.4-7.6L197.9,795.1c-5-5-7.6-11.2-7.6-18.4c0-7.2,2.5-13.4,7.6-18.4l103.3-102.8c2.7-2.7,5.6-4.6,8.8-5.8c3.2-1.2,6.3-1.8,9.3-1.8c3.4,0,6.6,0.6,9.8,1.8c3.2,1.2,6.1,3.1,8.8,5.8c5,5,7.6,11.1,7.6,18.1c0,7.1-2.5,13.1-7.6,18.1l-59.5,59h479.7c7.1,0,13.1,2.5,18.1,7.6c5,5,7.6,11.3,7.6,18.6c0,7.1-2.5,13.1-7.6,18.1C771.3,800.2,765.3,802.7,758.2,802.7L758.2,802.7z"/>
108
- </g>
109
- </symbol>
110
- </svg>
111
- </div>
112
-
113
-
114
-
115
-
116
- <div id='react'></div>
117
-
118
- <script src="./js/main.js"></script>
119
-
120
-
121
- </body>
122
-
123
-
124
-
125
-
126
-
127
- </html>