@kaizen/components 1.70.21 → 1.70.23

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 (27) hide show
  1. package/dist/cjs/RichTextEditor/RichTextEditor/utils/controlmap.cjs +1 -0
  2. package/dist/cjs/RichTextEditor/utils/commands/fixtures/mockRangeForBoundingRect.cjs +40 -0
  3. package/dist/cjs/RichTextEditor/utils/plugins/LinkManager/LinkManager.cjs +1 -0
  4. package/dist/cjs/index.cjs +2 -0
  5. package/dist/esm/RichTextEditor/RichTextEditor/utils/controlmap.mjs +1 -0
  6. package/dist/esm/RichTextEditor/utils/commands/fixtures/mockRangeForBoundingRect.mjs +38 -0
  7. package/dist/esm/RichTextEditor/utils/plugins/LinkManager/LinkManager.mjs +1 -0
  8. package/dist/esm/index.mjs +1 -0
  9. package/dist/styles.css +8511 -8511
  10. package/dist/types/Filter/FilterMultiSelect/types.d.ts +2 -1
  11. package/dist/types/RichTextEditor/utils/commands/fixtures/helpers.d.ts +0 -1
  12. package/dist/types/RichTextEditor/utils/commands/fixtures/index.d.ts +2 -0
  13. package/dist/types/RichTextEditor/utils/commands/fixtures/mockRangeForBoundingRect.d.ts +1 -0
  14. package/dist/types/RichTextEditor/utils/commands/index.d.ts +1 -0
  15. package/package.json +1 -1
  16. package/src/Filter/FilterMultiSelect/types.ts +3 -1
  17. package/src/RichTextEditor/utils/commands/addMark.spec.ts +1 -5
  18. package/src/RichTextEditor/utils/commands/fixtures/helpers.ts +0 -31
  19. package/src/RichTextEditor/utils/commands/fixtures/index.ts +2 -0
  20. package/src/RichTextEditor/utils/commands/fixtures/mockRangeForBoundingRect.ts +32 -0
  21. package/src/RichTextEditor/utils/commands/index.ts +1 -0
  22. package/src/__rc__/Button/_docs/Button--usage-guidelines.mdx +170 -1
  23. package/src/__rc__/Button/_docs/Button.docs.stories.tsx +264 -9
  24. package/src/__rc__/Button/_docs/assets/button_anatomy.png +0 -0
  25. package/src/__rc__/Button/_docs/assets/button_icon_only_spec.png +0 -0
  26. package/src/__rc__/Button/_docs/assets/button_icon_spec.png +0 -0
  27. package/src/__rc__/Button/_docs/assets/button_spec.png +0 -0
@@ -3,6 +3,7 @@
3
3
  var tslib = require('tslib');
4
4
  var React = require('react');
5
5
  var Icon = require('../../../__rc__/Icon/Icon.cjs');
6
+ require('vitest');
6
7
  var listIsActive = require('../../utils/commands/listIsActive.cjs');
7
8
  var markIsActive = require('../../utils/commands/markIsActive.cjs');
8
9
  require('prosemirror-transform');
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ var vitest = require('vitest');
4
+
5
+ // eslint-disable-next-line import/no-extraneous-dependencies
6
+ /*
7
+ ** This is used handle the JSDom type error issue you may encounter in testing
8
+ ** See https://github.com/jsdom/jsdom/issues/3002
9
+ */
10
+ var mockRangeForBoundingRect = function () {
11
+ vitest.vi.spyOn(document, 'createRange').mockImplementation(function () {
12
+ var range = new Range();
13
+ range.getBoundingClientRect = function () {
14
+ return {
15
+ x: 0,
16
+ y: 0,
17
+ bottom: 0,
18
+ height: 0,
19
+ left: 0,
20
+ right: 0,
21
+ top: 0,
22
+ width: 0,
23
+ toJSON: function () {
24
+ return undefined;
25
+ }
26
+ };
27
+ };
28
+ range.getClientRects = function () {
29
+ var _a;
30
+ return _a = {
31
+ item: function () {
32
+ return null;
33
+ },
34
+ length: 0
35
+ }, _a[Symbol.iterator] = vitest.vi.fn(), _a;
36
+ };
37
+ return range;
38
+ });
39
+ };
40
+ exports.mockRangeForBoundingRect = mockRangeForBoundingRect;
@@ -2,6 +2,7 @@
2
2
 
3
3
  var debounce = require('lodash.debounce');
4
4
  var ProseMirrorState = require('prosemirror-state');
5
+ require('vitest');
5
6
  var getMarkAttrs = require('../../commands/getMarkAttrs.cjs');
6
7
  var getMarkRange = require('../../commands/getMarkRange.cjs');
7
8
  require('prosemirror-utils');
@@ -355,6 +355,7 @@ var RichTextEditor = require('./RichTextEditor/RichTextEditor/RichTextEditor.cjs
355
355
  var ToggleIconButton = require('./RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/ToggleIconButton.cjs');
356
356
  var Toolbar = require('./RichTextEditor/RichTextEditor/subcomponents/Toolbar/Toolbar.cjs');
357
357
  var ToolbarSection = require('./RichTextEditor/RichTextEditor/subcomponents/ToolbarSection/ToolbarSection.cjs');
358
+ var mockRangeForBoundingRect = require('./RichTextEditor/utils/commands/fixtures/mockRangeForBoundingRect.cjs');
358
359
  var addMark = require('./RichTextEditor/utils/commands/addMark.cjs');
359
360
  var getMarkAttrs = require('./RichTextEditor/utils/commands/getMarkAttrs.cjs');
360
361
  var getMarkRange = require('./RichTextEditor/utils/commands/getMarkRange.cjs');
@@ -981,6 +982,7 @@ exports.RichTextEditor = RichTextEditor.RichTextEditor;
981
982
  exports.ToggleIconButton = ToggleIconButton.ToggleIconButton;
982
983
  exports.Toolbar = Toolbar.Toolbar;
983
984
  exports.ToolbarSection = ToolbarSection.ToolbarSection;
985
+ exports.mockRangeForBoundingRect = mockRangeForBoundingRect.mockRangeForBoundingRect;
984
986
  exports.addMark = addMark.addMark;
985
987
  exports.getMarkAttrs = getMarkAttrs.getMarkAttrs;
986
988
  exports.getMarkRange = getMarkRange.getMarkRange;
@@ -1,6 +1,7 @@
1
1
  import { __assign } from 'tslib';
2
2
  import React from 'react';
3
3
  import { Icon } from '../../../__rc__/Icon/Icon.mjs';
4
+ import 'vitest';
4
5
  import { listIsActive } from '../../utils/commands/listIsActive.mjs';
5
6
  import { markIsActive } from '../../utils/commands/markIsActive.mjs';
6
7
  import 'prosemirror-transform';
@@ -0,0 +1,38 @@
1
+ import { vi } from 'vitest';
2
+
3
+ // eslint-disable-next-line import/no-extraneous-dependencies
4
+ /*
5
+ ** This is used handle the JSDom type error issue you may encounter in testing
6
+ ** See https://github.com/jsdom/jsdom/issues/3002
7
+ */
8
+ var mockRangeForBoundingRect = function () {
9
+ vi.spyOn(document, 'createRange').mockImplementation(function () {
10
+ var range = new Range();
11
+ range.getBoundingClientRect = function () {
12
+ return {
13
+ x: 0,
14
+ y: 0,
15
+ bottom: 0,
16
+ height: 0,
17
+ left: 0,
18
+ right: 0,
19
+ top: 0,
20
+ width: 0,
21
+ toJSON: function () {
22
+ return undefined;
23
+ }
24
+ };
25
+ };
26
+ range.getClientRects = function () {
27
+ var _a;
28
+ return _a = {
29
+ item: function () {
30
+ return null;
31
+ },
32
+ length: 0
33
+ }, _a[Symbol.iterator] = vi.fn(), _a;
34
+ };
35
+ return range;
36
+ });
37
+ };
38
+ export { mockRangeForBoundingRect };
@@ -1,5 +1,6 @@
1
1
  import debounce from 'lodash.debounce';
2
2
  import { Plugin } from 'prosemirror-state';
3
+ import 'vitest';
3
4
  import { getMarkAttrs } from '../../commands/getMarkAttrs.mjs';
4
5
  import { getMarkRange } from '../../commands/getMarkRange.mjs';
5
6
  import 'prosemirror-utils';
@@ -353,6 +353,7 @@ export { RichTextEditor } from './RichTextEditor/RichTextEditor/RichTextEditor.m
353
353
  export { ToggleIconButton } from './RichTextEditor/RichTextEditor/subcomponents/ToggleIconButton/ToggleIconButton.mjs';
354
354
  export { Toolbar } from './RichTextEditor/RichTextEditor/subcomponents/Toolbar/Toolbar.mjs';
355
355
  export { ToolbarSection } from './RichTextEditor/RichTextEditor/subcomponents/ToolbarSection/ToolbarSection.mjs';
356
+ export { mockRangeForBoundingRect } from './RichTextEditor/utils/commands/fixtures/mockRangeForBoundingRect.mjs';
356
357
  export { addMark } from './RichTextEditor/utils/commands/addMark.mjs';
357
358
  export { getMarkAttrs } from './RichTextEditor/utils/commands/getMarkAttrs.mjs';
358
359
  export { getMarkRange } from './RichTextEditor/utils/commands/getMarkRange.mjs';