@pareto-engineering/design-system 4.0.0-alpha.69 → 4.0.0-alpha.72

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 (161) hide show
  1. package/.storybook/preview.js +29 -12
  2. package/dist/cjs/a/AnimatedGradient/AnimatedGradient.js +0 -1
  3. package/dist/cjs/a/AnimatedGradient/webGIRenderer.js +0 -1
  4. package/dist/cjs/a/AppContext/ContextProvider.js +2 -0
  5. package/dist/cjs/{c/ContentSlides/common/Slide/Slide.js → a/LexicalPreview/LexicalPreview.js} +43 -28
  6. package/dist/cjs/{c/ContentSlides/common/HorizontalMenu → a/LexicalPreview}/index.js +3 -3
  7. package/dist/cjs/a/LexicalPreview/styles.scss +46 -0
  8. package/dist/cjs/a/People/common/Person/Person.js +7 -2
  9. package/dist/cjs/a/ProgressBar/ProgressBar.js +3 -3
  10. package/dist/cjs/a/ProgressBar/styles.scss +11 -1
  11. package/dist/cjs/a/XMLEditor/XMLEditor.js +123 -0
  12. package/dist/cjs/{c/ContentSlides/common/Slide → a/XMLEditor/common}/index.js +3 -3
  13. package/dist/cjs/a/XMLEditor/common/theme.js +186 -0
  14. package/dist/cjs/{c/ContentSlides/common/Navigator → a/XMLEditor}/index.js +3 -3
  15. package/dist/cjs/a/XMLEditor/styles.scss +17 -0
  16. package/dist/cjs/a/index.js +15 -1
  17. package/dist/cjs/b/ExpandableLexicalPreview/ExpandableLexicalPreview.js +125 -0
  18. package/dist/cjs/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +112 -0
  19. package/dist/cjs/{c/ContentSlides/common/Sidebar → b/ExpandableLexicalPreview/common/ExpandButton}/index.js +3 -3
  20. package/dist/cjs/b/ExpandableLexicalPreview/common/index.js +12 -0
  21. package/dist/cjs/b/ExpandableLexicalPreview/index.js +13 -0
  22. package/dist/cjs/b/ExpandableLexicalPreview/styles.scss +84 -0
  23. package/dist/cjs/b/Logo/Logo.js +0 -1
  24. package/dist/cjs/b/Title/Title.js +0 -1
  25. package/dist/cjs/b/index.js +8 -1
  26. package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +0 -2
  27. package/dist/cjs/c/index.js +0 -13
  28. package/dist/cjs/f/FormInput/FormInput.js +2 -0
  29. package/dist/cjs/f/fields/EditorInput/EditorInput.js +14 -3
  30. package/dist/cjs/f/fields/EditorInput/common/StopPropagationPlugin.js +30 -0
  31. package/dist/cjs/f/fields/EditorInput/common/index.js +7 -0
  32. package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +11 -1
  33. package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +32 -3
  34. package/dist/cjs/index.js +0 -11
  35. package/dist/cjs/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +0 -1
  36. package/dist/es/a/AnimatedGradient/AnimatedGradient.js +0 -1
  37. package/dist/es/a/AnimatedGradient/webGIRenderer.js +0 -1
  38. package/dist/es/a/BlurOverlay/BlurOverlay.js +0 -1
  39. package/dist/es/a/DotInfo/DotInfo.js +0 -1
  40. package/dist/es/a/LexicalPreview/LexicalPreview.js +80 -0
  41. package/dist/es/a/LexicalPreview/index.js +2 -0
  42. package/dist/es/a/LexicalPreview/styles.scss +46 -0
  43. package/dist/es/a/People/common/Person/Person.js +22 -15
  44. package/dist/es/a/ProgressBar/ProgressBar.js +3 -3
  45. package/dist/es/a/ProgressBar/styles.scss +11 -1
  46. package/dist/es/a/XMLEditor/XMLEditor.js +112 -0
  47. package/dist/es/a/XMLEditor/common/index.js +1 -0
  48. package/dist/es/a/XMLEditor/common/theme.js +180 -0
  49. package/dist/es/a/XMLEditor/index.js +1 -0
  50. package/dist/es/a/XMLEditor/styles.scss +17 -0
  51. package/dist/es/a/index.js +3 -1
  52. package/dist/es/b/ExpandableLexicalPreview/ExpandableLexicalPreview.js +115 -0
  53. package/dist/es/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +102 -0
  54. package/dist/es/b/ExpandableLexicalPreview/common/ExpandButton/index.js +1 -0
  55. package/dist/es/b/ExpandableLexicalPreview/common/index.js +1 -0
  56. package/dist/es/b/ExpandableLexicalPreview/index.js +2 -0
  57. package/dist/es/b/ExpandableLexicalPreview/styles.scss +84 -0
  58. package/dist/es/b/Logo/Logo.js +0 -1
  59. package/dist/es/b/Title/Title.js +0 -1
  60. package/dist/es/b/index.js +2 -1
  61. package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +0 -2
  62. package/dist/es/c/index.js +0 -1
  63. package/dist/es/f/fields/EditorInput/EditorInput.js +15 -4
  64. package/dist/es/f/fields/EditorInput/common/StopPropagationPlugin.js +23 -0
  65. package/dist/es/f/fields/EditorInput/common/index.js +2 -1
  66. package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +11 -1
  67. package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +32 -3
  68. package/dist/es/index.js +0 -1
  69. package/dist/es/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +0 -1
  70. package/package.json +7 -5
  71. package/src/stories/StyleGuide/ai-icons.stories.mdx +27 -0
  72. package/src/stories/StyleGuide/icons.stories.mdx +22 -22
  73. package/src/stories/a/LexicalPreview.stories.jsx +28 -0
  74. package/src/stories/a/ProgressBar.stories.jsx +1 -1
  75. package/src/stories/a/XMLEditor.stories.jsx +21 -0
  76. package/src/stories/b/ExpandableLexicalPreview.stories.jsx +29 -0
  77. package/src/stories/colors.js +4 -0
  78. package/src/stories/f/QueryCombobox.stories.jsx +22 -0
  79. package/src/ui/a/LexicalPreview/LexicalPreview.jsx +109 -0
  80. package/src/ui/a/LexicalPreview/index.js +2 -0
  81. package/src/ui/a/LexicalPreview/styles.scss +46 -0
  82. package/src/ui/a/People/common/Person/Person.jsx +31 -19
  83. package/src/ui/a/ProgressBar/ProgressBar.jsx +2 -0
  84. package/src/ui/a/ProgressBar/styles.scss +11 -1
  85. package/src/ui/a/XMLEditor/XMLEditor.jsx +182 -0
  86. package/src/ui/a/XMLEditor/common/index.js +1 -0
  87. package/src/ui/a/XMLEditor/common/theme.jsx +184 -0
  88. package/src/ui/a/XMLEditor/index.js +1 -0
  89. package/src/ui/a/XMLEditor/styles.scss +17 -0
  90. package/src/ui/a/index.js +2 -0
  91. package/src/ui/b/ExpandableLexicalPreview/ExpandableLexicalPreview.jsx +157 -0
  92. package/src/ui/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.jsx +123 -0
  93. package/src/ui/b/ExpandableLexicalPreview/common/ExpandButton/index.js +1 -0
  94. package/src/ui/b/ExpandableLexicalPreview/common/index.js +1 -0
  95. package/src/ui/b/ExpandableLexicalPreview/index.js +2 -0
  96. package/src/ui/b/ExpandableLexicalPreview/styles.scss +84 -0
  97. package/src/ui/b/index.js +1 -0
  98. package/src/ui/c/index.js +0 -1
  99. package/src/ui/f/fields/EditorInput/EditorInput.jsx +16 -2
  100. package/src/ui/f/fields/EditorInput/common/StopPropagationPlugin.jsx +29 -0
  101. package/src/ui/f/fields/EditorInput/common/index.jsx +1 -0
  102. package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +12 -0
  103. package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +38 -1
  104. package/src/ui/index.js +0 -1
  105. package/tests/__snapshots__/Storyshots.test.js.snap +1531 -782
  106. package/dist/cjs/c/ContentSlides/ContentSlides.js +0 -172
  107. package/dist/cjs/c/ContentSlides/Context.js +0 -10
  108. package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +0 -124
  109. package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +0 -128
  110. package/dist/cjs/c/ContentSlides/common/Sidebar/Sidebar.js +0 -92
  111. package/dist/cjs/c/ContentSlides/common/index.js +0 -33
  112. package/dist/cjs/c/ContentSlides/index.js +0 -27
  113. package/dist/cjs/c/ContentSlides/styles.scss +0 -312
  114. package/dist/cjs/c/ContentSlides/useContentSlides.js +0 -11
  115. package/dist/cjs/r/SwitchRouteMap/SwitchRouteMap.js +0 -58
  116. package/dist/cjs/r/SwitchRouteMap/index.js +0 -13
  117. package/dist/cjs/r/common/PrivateRoute/PrivateRoute.js +0 -75
  118. package/dist/cjs/r/common/PrivateRoute/index.js +0 -13
  119. package/dist/cjs/r/common/index.js +0 -12
  120. package/dist/cjs/r/index.js +0 -27
  121. package/dist/es/c/ContentSlides/ContentSlides.js +0 -160
  122. package/dist/es/c/ContentSlides/Context.js +0 -2
  123. package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +0 -116
  124. package/dist/es/c/ContentSlides/common/HorizontalMenu/index.js +0 -2
  125. package/dist/es/c/ContentSlides/common/Navigator/Navigator.js +0 -118
  126. package/dist/es/c/ContentSlides/common/Navigator/index.js +0 -2
  127. package/dist/es/c/ContentSlides/common/Sidebar/Sidebar.js +0 -84
  128. package/dist/es/c/ContentSlides/common/Sidebar/index.js +0 -2
  129. package/dist/es/c/ContentSlides/common/Slide/Slide.js +0 -65
  130. package/dist/es/c/ContentSlides/common/Slide/index.js +0 -2
  131. package/dist/es/c/ContentSlides/common/index.js +0 -4
  132. package/dist/es/c/ContentSlides/index.js +0 -4
  133. package/dist/es/c/ContentSlides/styles.scss +0 -312
  134. package/dist/es/c/ContentSlides/useContentSlides.js +0 -3
  135. package/dist/es/r/SwitchRouteMap/SwitchRouteMap.js +0 -45
  136. package/dist/es/r/SwitchRouteMap/index.js +0 -2
  137. package/dist/es/r/common/PrivateRoute/PrivateRoute.js +0 -67
  138. package/dist/es/r/common/PrivateRoute/index.js +0 -2
  139. package/dist/es/r/common/index.js +0 -1
  140. package/dist/es/r/index.js +0 -2
  141. package/src/stories/c/ContentSlides.stories.jsx +0 -214
  142. package/src/ui/c/ContentSlides/ContentSlides.jsx +0 -214
  143. package/src/ui/c/ContentSlides/Context.js +0 -3
  144. package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +0 -145
  145. package/src/ui/c/ContentSlides/common/HorizontalMenu/index.js +0 -2
  146. package/src/ui/c/ContentSlides/common/Navigator/Navigator.jsx +0 -150
  147. package/src/ui/c/ContentSlides/common/Navigator/index.js +0 -2
  148. package/src/ui/c/ContentSlides/common/Sidebar/Sidebar.jsx +0 -135
  149. package/src/ui/c/ContentSlides/common/Sidebar/index.js +0 -2
  150. package/src/ui/c/ContentSlides/common/Slide/Slide.jsx +0 -87
  151. package/src/ui/c/ContentSlides/common/Slide/index.js +0 -2
  152. package/src/ui/c/ContentSlides/common/index.js +0 -4
  153. package/src/ui/c/ContentSlides/index.js +0 -4
  154. package/src/ui/c/ContentSlides/styles.scss +0 -312
  155. package/src/ui/c/ContentSlides/useContentSlides.js +0 -4
  156. package/src/ui/r/SwitchRouteMap/SwitchRouteMap.jsx +0 -64
  157. package/src/ui/r/SwitchRouteMap/index.js +0 -2
  158. package/src/ui/r/common/PrivateRoute/PrivateRoute.jsx +0 -73
  159. package/src/ui/r/common/PrivateRoute/index.js +0 -2
  160. package/src/ui/r/common/index.js +0 -1
  161. package/src/ui/r/index.js +0 -2
@@ -1,14 +1,37 @@
1
1
  /** @type { import('@storybook/react').Preview } */
2
- // import '../src/local.scss'
3
- // import '@pareto-engineering/styles'
4
- // Same as
5
2
  import '@pareto-engineering/styles/dist/main.css'
6
3
 
7
4
  const preview = {
8
- parameters:{
9
- backgrounds:{
10
- default:'light',
5
+ globalTypes: {
6
+ theme: {
7
+ description: 'Swap theme',
8
+ defaultValue: 'ui-light',
9
+ toolbar: {
10
+ title: 'Theme',
11
+ icon: 'circlehollow',
12
+ items: [
13
+ {
14
+ value: 'ui-light', icon: 'circlehollow', title: 'light',
15
+ },
16
+ {
17
+ value: 'ui-dark', icon: 'circle', title: 'dark',
18
+ },
19
+ ],
20
+ dynamicTitle: true,
21
+ },
22
+ },
23
+ },
24
+ decorators: [
25
+ (Story, context) => {
26
+ const theme = context.parameters.theme || context.globals.theme
27
+ return (
28
+ <div className={theme}>
29
+ <Story />
30
+ </div>
31
+ )
11
32
  },
33
+ ],
34
+ parameters:{
12
35
  actions :{ argTypesRegex: '^on[A-Z].*' },
13
36
  controls:{
14
37
  matchers:{
@@ -16,12 +39,6 @@ const preview = {
16
39
  date :/Date$/,
17
40
  },
18
41
  },
19
- themes:[
20
- {
21
- name:'Light', class:'ui-light', color:'#EFEFEF', default:true,
22
- },
23
- { name: 'Dark', class: 'ui-dark', color: '#121212' },
24
- ],
25
42
  },
26
43
  }
27
44
 
@@ -47,7 +47,6 @@ const AnimatedGradient = _ref => {
47
47
  // {...otherProps}
48
48
  });
49
49
  };
50
-
51
50
  AnimatedGradient.propTypes = {
52
51
  /**
53
52
  * The HTML class names for this element
@@ -356,7 +356,6 @@ class Gradient {
356
356
  window.addEventListener("scroll", this.handleScroll), window.addEventListener("mousedown", this.handleMouseDown), window.addEventListener("mouseup", this.handleMouseUp), window.addEventListener("keydown", this.handleKeyDown), this.isIntersecting = !0, this.addIsLoadedClass(), this.play()
357
357
  }) */);
358
358
  }
359
-
360
359
  disconnect() {
361
360
  this.scrollObserver && (window.removeEventListener('scroll', this.handleScroll), window.removeEventListener('mousedown', this.handleMouseDown), window.removeEventListener('mouseup', this.handleMouseUp), window.removeEventListener('keydown', this.handleKeyDown), this.scrollObserver.disconnect()), window.removeEventListener('resize', this.resize);
362
361
  }
@@ -17,7 +17,9 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
17
17
  // Package-level Imports
18
18
 
19
19
  // Component-level imports
20
+
20
21
  // Helper Definitions
22
+
21
23
  const reducer = (state, action) => {
22
24
  switch (action.type) {
23
25
  case 'UPDATE_STATE':
@@ -5,49 +5,64 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
+ var _LexicalComposer = require("@lexical/react/LexicalComposer");
9
+ var _LexicalRichTextPlugin = require("@lexical/react/LexicalRichTextPlugin");
10
+ var _LexicalContentEditable = require("@lexical/react/LexicalContentEditable");
11
+ var _link = require("@lexical/link");
12
+ var _list = require("@lexical/list");
8
13
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
14
  var _exports = _interopRequireDefault(require("@pareto-engineering/bem/exports"));
10
- var _useContentSlides = _interopRequireDefault(require("../../useContentSlides"));
15
+ require("./styles.scss");
11
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
17
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
18
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
19
  /* @pareto-engineering/generator-front 1.0.12 */
20
+ /* eslint-disable import/no-extraneous-dependencies -- required here */
15
21
 
16
22
  // Local Definitions
17
23
 
18
- // const baseClassName = styleNames.base
19
-
20
- const componentClassName = 'slide';
24
+ const baseClassName = _exports.default.base;
25
+ const componentClassName = 'lexical-preview';
21
26
 
22
27
  /**
23
28
  * This is the component description.
24
29
  */
25
- const Slide = _ref => {
30
+ const LexicalPreview = _ref => {
26
31
  let {
27
32
  id,
28
33
  className: userClassName,
29
34
  style,
30
- children,
31
- index
35
+ nodes,
36
+ color
32
37
  // ...otherProps
33
38
  } = _ref;
34
- const {
35
- currentStepIndex
36
- } = (0, _useContentSlides.default)();
37
- const isActive = currentStepIndex === index;
38
- return /*#__PURE__*/React.createElement("div", {
39
+ const initialConfig = {
40
+ nameSpace: id,
41
+ editable: false,
42
+ editorState: nodes,
43
+ theme: {
44
+ text: {
45
+ italic: 'italic',
46
+ strikethrough: 'strikethrough',
47
+ underline: 'underlined'
48
+ }
49
+ },
50
+ nodes: [_link.AutoLinkNode, _link.LinkNode, _list.ListNode, _list.ListItemNode]
51
+ };
52
+ return /*#__PURE__*/React.createElement(_LexicalComposer.LexicalComposer, {
53
+ initialConfig: initialConfig
54
+ }, /*#__PURE__*/React.createElement("div", {
39
55
  id: id,
40
- className: [
41
- // baseClassName,
42
- isActive && _exports.default.modifierActive, componentClassName, userClassName].filter(e => e).join(' '),
56
+ className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
43
57
  style: style
44
- }, /*#__PURE__*/React.createElement("div", {
45
- className: "wrapper"
46
- }, /*#__PURE__*/React.createElement("div", {
47
- className: "content"
48
- }, children)));
58
+ }, /*#__PURE__*/React.createElement(_LexicalRichTextPlugin.RichTextPlugin, {
59
+ contentEditable: /*#__PURE__*/React.createElement(_LexicalContentEditable.ContentEditable, {
60
+ id: id,
61
+ className: "content-editable"
62
+ })
63
+ })));
49
64
  };
50
- Slide.propTypes = {
65
+ LexicalPreview.propTypes = {
51
66
  /**
52
67
  * The HTML id for this element
53
68
  */
@@ -61,15 +76,15 @@ Slide.propTypes = {
61
76
  */
62
77
  style: _propTypes.default.objectOf(_propTypes.default.string),
63
78
  /**
64
- * The children JSX
79
+ * Color of the text
65
80
  */
66
- children: _propTypes.default.node,
81
+ color: _propTypes.default.string,
67
82
  /**
68
- * The index of this slide
83
+ * The nodes to render in the form of a json string
69
84
  */
70
- index: _propTypes.default.number
85
+ nodes: _propTypes.default.string
71
86
  };
72
- Slide.defaultProps = {
73
- // someProp:false
87
+ LexicalPreview.defaultProps = {
88
+ color: 'paragraph'
74
89
  };
75
- var _default = exports.default = Slide;
90
+ var _default = exports.default = LexicalPreview;
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "HorizontalMenu", {
6
+ Object.defineProperty(exports, "LexicalPreview", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _HorizontalMenu.default;
9
+ return _LexicalPreview.default;
10
10
  }
11
11
  });
12
- var _HorizontalMenu = _interopRequireDefault(require("./HorizontalMenu"));
12
+ var _LexicalPreview = _interopRequireDefault(require("./LexicalPreview"));
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,46 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+
3
+ @use "@pareto-engineering/bem";
4
+ @use "@pareto-engineering/styles/src/mixins";
5
+ @use "@pareto-engineering/styles/src/globals" as *;
6
+
7
+ .#{bem.$base}.lexical-preview {
8
+ > .content-editable {
9
+ color: var(--y);
10
+ overflow: auto;
11
+
12
+ li:has(ol, ul) {
13
+ list-style-type: none;
14
+ }
15
+
16
+ p,
17
+ span,
18
+ strong,
19
+ em,
20
+ li {
21
+ &.underlined {
22
+ text-decoration: underline;
23
+
24
+ &.strikethrough {
25
+ text-decoration: underline line-through;
26
+ }
27
+ }
28
+
29
+ &.strikethrough {
30
+ text-decoration: line-through;
31
+ }
32
+
33
+ &.italic {
34
+ font-style: italic;
35
+ }
36
+ }
37
+
38
+ :first-child {
39
+ margin-top: 0;
40
+ }
41
+
42
+ &::placeholder {
43
+ color: var(--metadata);
44
+ }
45
+ }
46
+ }
@@ -31,14 +31,19 @@ const Person = _ref => {
31
31
  color
32
32
  // ...otherProps
33
33
  } = _ref;
34
+ const handleImageSrcError = e => {
35
+ e.target.onerror = null;
36
+ e.target.src = '/default-avatar.svg';
37
+ };
34
38
  return /*#__PURE__*/React.createElement("div", {
35
39
  id: id,
36
40
  className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
37
41
  style: style
38
42
  }, /*#__PURE__*/React.createElement("img", {
39
43
  className: "image v50 mr-v",
40
- src: image,
41
- alt: `${name}, ${role}`
44
+ src: image || '/default-avatar.svg',
45
+ alt: `${name}, ${role}`,
46
+ onError: handleImageSrcError
42
47
  }), /*#__PURE__*/React.createElement("div", {
43
48
  className: "details"
44
49
  }, name && /*#__PURE__*/React.createElement("p", {
@@ -29,12 +29,13 @@ const ProgressBar = _ref => {
29
29
  attached,
30
30
  color,
31
31
  progress,
32
- height
32
+ height,
33
+ rounded
33
34
  // ...otherProps
34
35
  } = _ref;
35
36
  return /*#__PURE__*/React.createElement("div", {
36
37
  id: id,
37
- className: [baseClassName, componentClassName, attached && _exports.default.modifierAttached, color && `x-${color}`, userClassName].filter(e => e).join(' '),
38
+ className: [baseClassName, componentClassName, attached && _exports.default.modifierAttached, color && `x-${color}`, userClassName, rounded && 'rounded'].filter(e => e).join(' '),
38
39
  style: {
39
40
  '--progress': progress,
40
41
  '--height': height,
@@ -44,7 +45,6 @@ const ProgressBar = _ref => {
44
45
  // {...otherProps}
45
46
  });
46
47
  };
47
-
48
48
  ProgressBar.propTypes = {
49
49
  /**
50
50
  * The HTML id for this element
@@ -5,9 +5,11 @@
5
5
  $default-height:var(--height, 1em);
6
6
  $default-border:none;//2px solid var(--grid);
7
7
  $default-transition-duration:.5s;
8
- $default-color:var(--x, var(--main1));
8
+ $default-color:var(--x, var(--main));
9
+ $default-border-radius:var(--theme-border-radius, 1.875rem);
9
10
 
10
11
  .#{bem.$base}.progress-bar {
12
+ background-color: var(--progress-bar-background-color);
11
13
  border: $default-border;
12
14
  height: $default-height;
13
15
  position: relative;
@@ -28,6 +30,14 @@ $default-color:var(--x, var(--main1));
28
30
  z-index: 1;
29
31
  }
30
32
 
33
+ &.rounded {
34
+ border-radius: $default-border-radius;
35
+
36
+ &::after {
37
+ border-radius: $default-border-radius;
38
+ }
39
+ }
40
+
31
41
  &.#{bem.$modifier-attached} {
32
42
  border: unset;
33
43
  border-bottom: $default-border;
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var React = _react;
9
+ var _propTypes = _interopRequireDefault(require("prop-types"));
10
+ var _state = require("@codemirror/state");
11
+ var _view = require("@codemirror/view");
12
+ var _commands = require("@codemirror/commands");
13
+ var _language = require("@codemirror/language");
14
+ var _langXml = require("@codemirror/lang-xml");
15
+ var _exports = _interopRequireDefault(require("@pareto-engineering/bem/exports"));
16
+ var _common = require("./common");
17
+ require("./styles.scss");
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
20
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
21
+ /* eslint-disable import/no-extraneous-dependencies */
22
+
23
+ const baseClassName = _exports.default.base;
24
+ const componentClassName = 'code-editor';
25
+
26
+ /**
27
+ * codemirror documentation:
28
+ * https://codemirror.net/
29
+ */
30
+
31
+ const XMLEditor = _ref => {
32
+ let {
33
+ id,
34
+ className: userClassName,
35
+ style,
36
+ readOnly,
37
+ height,
38
+ gutterWidth,
39
+ config,
40
+ onChange,
41
+ stopPropagationKeys
42
+ } = _ref;
43
+ const editorRef = (0, _react.useRef)();
44
+ (0, _react.useEffect)(() => {
45
+ const startState = _state.EditorState.create({
46
+ doc: config,
47
+ extensions: [_view.keymap.of(_commands.defaultKeymap), (0, _language.indentOnInput)(), (0, _view.lineNumbers)(), (0, _language.bracketMatching)(), (0, _language.foldGutter)(), (0, _view.drawSelection)(), (0, _view.highlightActiveLine)(), (0, _view.highlightActiveLineGutter)(), (0, _view.highlightSpecialChars)(), (0, _view.dropCursor)(), (0, _view.rectangularSelection)(), (0, _view.crosshairCursor)(), (0, _langXml.xml)(), _common.theme, _state.EditorState.readOnly.of(readOnly), _view.EditorView.updateListener.of(view => {
48
+ onChange(view);
49
+ // view.state.doc.toString() to receive the current content in the editor.
50
+ }), _view.EditorView.domEventHandlers({
51
+ keydown(e) {
52
+ if (stopPropagationKeys?.includes(e.key)) {
53
+ e.stopPropagation();
54
+ }
55
+ }
56
+ })]
57
+ });
58
+ const view = new _view.EditorView({
59
+ state: startState,
60
+ parent: editorRef.current
61
+ });
62
+ return () => {
63
+ view.destroy();
64
+ };
65
+ }, [editorRef]);
66
+ return /*#__PURE__*/React.createElement("div", {
67
+ id: id,
68
+ ref: editorRef,
69
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
70
+ style: {
71
+ '--height': height,
72
+ '--gutter-width': gutterWidth,
73
+ ...style
74
+ }
75
+ });
76
+ };
77
+ XMLEditor.propTypes = {
78
+ /**
79
+ * The HTML id for this element
80
+ */
81
+ id: _propTypes.default.string,
82
+ /**
83
+ * The HTML class names for this element
84
+ */
85
+ className: _propTypes.default.string,
86
+ /**
87
+ * The React-written, css properties for this element.
88
+ */
89
+ style: _propTypes.default.objectOf(_propTypes.default.string),
90
+ /**
91
+ * Whether or not the content is read only.
92
+ */
93
+ readOnly: _propTypes.default.bool,
94
+ /**
95
+ * The initial labeling configuration.
96
+ */
97
+ config: _propTypes.default.string,
98
+ /**
99
+ * The height of the editor.
100
+ */
101
+ height: _propTypes.default.string,
102
+ /**
103
+ * The callback for when the labeling configuration changes.
104
+ */
105
+ onChange: _propTypes.default.func,
106
+ /**
107
+ * The width of the gutter.
108
+ */
109
+ gutterWidth: _propTypes.default.string,
110
+ /**
111
+ * The keys to stop propagation on.
112
+ */
113
+ stopPropagationKeys: _propTypes.default.arrayOf(_propTypes.default.string)
114
+ };
115
+ XMLEditor.defaultProps = {
116
+ config: `<View>
117
+ <!--Edit this config to customize the labeling interface.-->
118
+ </View>
119
+ `,
120
+ height: '20em',
121
+ gutterWidth: '3em'
122
+ };
123
+ var _default = exports.default = XMLEditor;
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "Slide", {
6
+ Object.defineProperty(exports, "theme", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _Slide.default;
9
+ return _theme.default;
10
10
  }
11
11
  });
12
- var _Slide = _interopRequireDefault(require("./Slide"));
12
+ var _theme = _interopRequireDefault(require("./theme"));
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,186 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _view = require("@codemirror/view");
8
+ var _language = require("@codemirror/language");
9
+ var _highlight = require("@lezer/highlight");
10
+ /* eslint-disable import/no-extraneous-dependencies */
11
+
12
+ // Using https://github.com/one-dark/vscode-one-dark-theme/ as reference for the colors
13
+ const chalky = '#e5c07b';
14
+ const coral = '#e06c75';
15
+ const cyan = '#56b6c2';
16
+ const invalid = '#ffffff';
17
+ const ivory = '#abb2bf';
18
+ const stone = '#7d8799'; // Brightened compared to original to increase contrast
19
+ const malibu = '#61afef';
20
+ const sage = '#98c379';
21
+ const whiskey = '#d19a66';
22
+ const violet = '#c678dd';
23
+ const darkBackground = '#21252b';
24
+ const highlightBackground = '#2c313a';
25
+ const background = '#282c34';
26
+ const tooltipBackground = '#353a42';
27
+ const selection = '#3E4451';
28
+ const cursor = '#528bff';
29
+ /**
30
+ The colors used in the theme, as CSS color strings.
31
+ */
32
+ // const color = {
33
+ // chalky,
34
+ // coral,
35
+ // cyan,
36
+ // invalid,
37
+ // ivory,
38
+ // stone,
39
+ // malibu,
40
+ // sage,
41
+ // whiskey,
42
+ // violet,
43
+ // darkBackground,
44
+ // highlightBackground,
45
+ // background,
46
+ // tooltipBackground,
47
+ // selection,
48
+ // cursor
49
+ // };
50
+ /**
51
+ The editor theme styles for One Dark.
52
+ */
53
+ const oneDarkTheme = /* @__PURE__ */_view.EditorView.theme({
54
+ '&': {
55
+ color: ivory,
56
+ backgroundColor: background
57
+ },
58
+ '.cm-content': {
59
+ caretColor: cursor
60
+ },
61
+ '.cm-cursor, .cm-dropCursor': {
62
+ borderLeftColor: cursor
63
+ },
64
+ '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
65
+ backgroundColor: selection
66
+ },
67
+ '.cm-panels': {
68
+ backgroundColor: darkBackground,
69
+ color: ivory
70
+ },
71
+ '.cm-panels.cm-panels-top': {
72
+ borderBottom: '2px solid black'
73
+ },
74
+ '.cm-panels.cm-panels-bottom': {
75
+ borderTop: '2px solid black'
76
+ },
77
+ '.cm-searchMatch': {
78
+ backgroundColor: '#72a1ff59',
79
+ outline: '1px solid #457dff'
80
+ },
81
+ '.cm-searchMatch.cm-searchMatch-selected': {
82
+ backgroundColor: '#6199ff2f'
83
+ },
84
+ '.cm-activeLine': {
85
+ backgroundColor: '#6699ff0b'
86
+ },
87
+ '.cm-selectionMatch': {
88
+ backgroundColor: '#aafe661a'
89
+ },
90
+ '&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket': {
91
+ backgroundColor: '#bad0f847'
92
+ },
93
+ '.cm-gutters': {
94
+ backgroundColor: background,
95
+ color: stone,
96
+ border: 'none'
97
+ },
98
+ '.cm-activeLineGutter': {
99
+ backgroundColor: highlightBackground
100
+ },
101
+ '.cm-foldPlaceholder': {
102
+ backgroundColor: 'transparent',
103
+ border: 'none',
104
+ color: '#ddd'
105
+ },
106
+ '.cm-tooltip': {
107
+ border: 'none',
108
+ backgroundColor: tooltipBackground
109
+ },
110
+ '.cm-tooltip .cm-tooltip-arrow:before': {
111
+ borderTopColor: 'transparent',
112
+ borderBottomColor: 'transparent'
113
+ },
114
+ '.cm-tooltip .cm-tooltip-arrow:after': {
115
+ borderTopColor: tooltipBackground,
116
+ borderBottomColor: tooltipBackground
117
+ },
118
+ '.cm-tooltip-autocomplete': {
119
+ '& > ul > li[aria-selected]': {
120
+ backgroundColor: highlightBackground,
121
+ color: ivory
122
+ }
123
+ }
124
+ }, {
125
+ dark: true
126
+ });
127
+ /**
128
+ The highlighting style for code in the One Dark theme.
129
+ */
130
+ const oneDarkHighlightStyle = /* @__PURE__ */_language.HighlightStyle.define([{
131
+ tag: _highlight.tags.keyword,
132
+ color: violet
133
+ }, {
134
+ tag: [_highlight.tags.name, _highlight.tags.deleted, _highlight.tags.character, _highlight.tags.propertyName, _highlight.tags.macroName],
135
+ color: coral
136
+ }, {
137
+ tag: [/* @__PURE__ */_highlight.tags.function(_highlight.tags.variableName), _highlight.tags.labelName],
138
+ color: malibu
139
+ }, {
140
+ tag: [_highlight.tags.color, /* @__PURE__ */_highlight.tags.constant(_highlight.tags.name), /* @__PURE__ */_highlight.tags.standard(_highlight.tags.name)],
141
+ color: whiskey
142
+ }, {
143
+ tag: [/* @__PURE__ */_highlight.tags.definition(_highlight.tags.name), _highlight.tags.separator],
144
+ color: ivory
145
+ }, {
146
+ tag: [_highlight.tags.typeName, _highlight.tags.className, _highlight.tags.number, _highlight.tags.changed, _highlight.tags.annotation, _highlight.tags.modifier, _highlight.tags.self, _highlight.tags.namespace],
147
+ color: chalky
148
+ }, {
149
+ tag: [_highlight.tags.operator, _highlight.tags.operatorKeyword, _highlight.tags.url, _highlight.tags.escape, _highlight.tags.regexp, _highlight.tags.link, /* @__PURE__ */_highlight.tags.special(_highlight.tags.string)],
150
+ color: cyan
151
+ }, {
152
+ tag: [_highlight.tags.meta, _highlight.tags.comment],
153
+ color: stone
154
+ }, {
155
+ tag: _highlight.tags.strong,
156
+ fontWeight: 'bold'
157
+ }, {
158
+ tag: _highlight.tags.emphasis,
159
+ fontStyle: 'italic'
160
+ }, {
161
+ tag: _highlight.tags.strikethrough,
162
+ textDecoration: 'line-through'
163
+ }, {
164
+ tag: _highlight.tags.link,
165
+ color: stone,
166
+ textDecoration: 'underline'
167
+ }, {
168
+ tag: _highlight.tags.heading,
169
+ fontWeight: 'bold',
170
+ color: coral
171
+ }, {
172
+ tag: [_highlight.tags.atom, _highlight.tags.bool, /* @__PURE__ */_highlight.tags.special(_highlight.tags.variableName)],
173
+ color: whiskey
174
+ }, {
175
+ tag: [_highlight.tags.processingInstruction, _highlight.tags.string, _highlight.tags.inserted],
176
+ color: sage
177
+ }, {
178
+ tag: _highlight.tags.invalid,
179
+ color: invalid
180
+ }]);
181
+ /**
182
+ Extension to enable the One Dark theme (both the editor theme and
183
+ the highlight style).
184
+ */
185
+ const oneDark = [oneDarkTheme, /* @__PURE__ */(0, _language.syntaxHighlighting)(oneDarkHighlightStyle)];
186
+ var _default = exports.default = oneDark;
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "Navigator", {
6
+ Object.defineProperty(exports, "XMLEditor", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _Navigator.default;
9
+ return _XMLEditor.default;
10
10
  }
11
11
  });
12
- var _Navigator = _interopRequireDefault(require("./Navigator"));
12
+ var _XMLEditor = _interopRequireDefault(require("./XMLEditor"));
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }