@qoretechnologies/reqore 0.78.5-pr.708.gfe16b52 → 0.78.5

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 (121) hide show
  1. package/.claude/CLAUDE.md +12 -4
  2. package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
  3. package/dist/components/Breadcrumbs/index.js +262 -75
  4. package/dist/components/Breadcrumbs/index.js.map +1 -1
  5. package/dist/components/Breadcrumbs/item.d.ts +0 -10
  6. package/dist/components/Breadcrumbs/item.d.ts.map +1 -1
  7. package/dist/components/Breadcrumbs/item.js +3 -24
  8. package/dist/components/Breadcrumbs/item.js.map +1 -1
  9. package/dist/components/ControlGroup/index.d.ts.map +1 -1
  10. package/dist/components/ControlGroup/index.js +5 -1
  11. package/dist/components/ControlGroup/index.js.map +1 -1
  12. package/dist/components/DataView/index.d.ts.map +1 -1
  13. package/dist/components/DataView/index.js +5 -6
  14. package/dist/components/DataView/index.js.map +1 -1
  15. package/dist/components/Drawer/index.d.ts.map +1 -1
  16. package/dist/components/Drawer/index.js +34 -7
  17. package/dist/components/Drawer/index.js.map +1 -1
  18. package/dist/components/Dropdown/index.d.ts.map +1 -1
  19. package/dist/components/Dropdown/index.js +3 -1
  20. package/dist/components/Dropdown/index.js.map +1 -1
  21. package/dist/components/Dropdown/list.d.ts.map +1 -1
  22. package/dist/components/Dropdown/list.js +71 -5
  23. package/dist/components/Dropdown/list.js.map +1 -1
  24. package/dist/components/EntityRow/index.d.ts.map +1 -1
  25. package/dist/components/EntityRow/index.js +10 -4
  26. package/dist/components/EntityRow/index.js.map +1 -1
  27. package/dist/components/InternalPopover/index.d.ts.map +1 -1
  28. package/dist/components/InternalPopover/index.js +32 -5
  29. package/dist/components/InternalPopover/index.js.map +1 -1
  30. package/dist/components/Menu/index.d.ts.map +1 -1
  31. package/dist/components/Menu/index.js +14 -8
  32. package/dist/components/Menu/index.js.map +1 -1
  33. package/dist/components/Menu/item.d.ts.map +1 -1
  34. package/dist/components/Menu/item.js +3 -2
  35. package/dist/components/Menu/item.js.map +1 -1
  36. package/dist/components/Menu/section.d.ts.map +1 -1
  37. package/dist/components/Menu/section.js +11 -6
  38. package/dist/components/Menu/section.js.map +1 -1
  39. package/dist/components/NavRail/index.d.ts.map +1 -1
  40. package/dist/components/NavRail/index.js +10 -0
  41. package/dist/components/NavRail/index.js.map +1 -1
  42. package/dist/components/Notifications/notification.d.ts.map +1 -1
  43. package/dist/components/Notifications/notification.js +11 -4
  44. package/dist/components/Notifications/notification.js.map +1 -1
  45. package/dist/components/Paging/index.d.ts.map +1 -1
  46. package/dist/components/Paging/index.js +17 -17
  47. package/dist/components/Paging/index.js.map +1 -1
  48. package/dist/components/Panel/index.d.ts.map +1 -1
  49. package/dist/components/Panel/index.js +123 -28
  50. package/dist/components/Panel/index.js.map +1 -1
  51. package/dist/components/Popover/index.d.ts +8 -0
  52. package/dist/components/Popover/index.d.ts.map +1 -1
  53. package/dist/components/Popover/index.js +145 -26
  54. package/dist/components/Popover/index.js.map +1 -1
  55. package/dist/components/Rating/index.d.ts.map +1 -1
  56. package/dist/components/Rating/index.js +9 -3
  57. package/dist/components/Rating/index.js.map +1 -1
  58. package/dist/components/RowActionsMenu/index.d.ts +22 -6
  59. package/dist/components/RowActionsMenu/index.d.ts.map +1 -1
  60. package/dist/components/RowActionsMenu/index.js +95 -18
  61. package/dist/components/RowActionsMenu/index.js.map +1 -1
  62. package/dist/components/SegmentedControl/index.d.ts.map +1 -1
  63. package/dist/components/SegmentedControl/index.js +3 -1
  64. package/dist/components/SegmentedControl/index.js.map +1 -1
  65. package/dist/components/SeverityRow/index.d.ts.map +1 -1
  66. package/dist/components/SeverityRow/index.js +6 -2
  67. package/dist/components/SeverityRow/index.js.map +1 -1
  68. package/dist/components/Statistic/index.d.ts.map +1 -1
  69. package/dist/components/Statistic/index.js +4 -1
  70. package/dist/components/Statistic/index.js.map +1 -1
  71. package/dist/components/Table/helpers.d.ts +5 -5
  72. package/dist/components/Table/helpers.d.ts.map +1 -1
  73. package/dist/components/Table/helpers.js +6 -7
  74. package/dist/components/Table/helpers.js.map +1 -1
  75. package/dist/components/Table/index.d.ts +15 -6
  76. package/dist/components/Table/index.d.ts.map +1 -1
  77. package/dist/components/Table/index.js +53 -21
  78. package/dist/components/Table/index.js.map +1 -1
  79. package/dist/components/Table/row.d.ts.map +1 -1
  80. package/dist/components/Table/row.js +21 -8
  81. package/dist/components/Table/row.js.map +1 -1
  82. package/dist/components/Tabs/list.d.ts.map +1 -1
  83. package/dist/components/Tabs/list.js +3 -1
  84. package/dist/components/Tabs/list.js.map +1 -1
  85. package/dist/components/Textarea/index.d.ts.map +1 -1
  86. package/dist/components/Textarea/index.js +36 -12
  87. package/dist/components/Textarea/index.js.map +1 -1
  88. package/dist/components/Timeline/index.d.ts.map +1 -1
  89. package/dist/components/Timeline/index.js +5 -4
  90. package/dist/components/Timeline/index.js.map +1 -1
  91. package/dist/components/Tree/modal.d.ts.map +1 -1
  92. package/dist/components/Tree/modal.js +3 -1
  93. package/dist/components/Tree/modal.js.map +1 -1
  94. package/dist/containers/ReqoreProvider.d.ts.map +1 -1
  95. package/dist/containers/ReqoreProvider.js +27 -13
  96. package/dist/containers/ReqoreProvider.js.map +1 -1
  97. package/dist/helpers/hoveringPointer.d.ts +54 -0
  98. package/dist/helpers/hoveringPointer.d.ts.map +1 -0
  99. package/dist/helpers/hoveringPointer.js +66 -0
  100. package/dist/helpers/hoveringPointer.js.map +1 -0
  101. package/dist/hooks/useCloneThroughFragments.d.ts.map +1 -1
  102. package/dist/hooks/useCloneThroughFragments.js +51 -18
  103. package/dist/hooks/useCloneThroughFragments.js.map +1 -1
  104. package/dist/hooks/useMarqueeOnHover.d.ts.map +1 -1
  105. package/dist/hooks/useMarqueeOnHover.js +10 -0
  106. package/dist/hooks/useMarqueeOnHover.js.map +1 -1
  107. package/dist/hooks/usePaging.d.ts +9 -4
  108. package/dist/hooks/usePaging.d.ts.map +1 -1
  109. package/dist/hooks/usePaging.js +21 -32
  110. package/dist/hooks/usePaging.js.map +1 -1
  111. package/dist/hooks/useReqoreMedia.d.ts +22 -7
  112. package/dist/hooks/useReqoreMedia.d.ts.map +1 -1
  113. package/dist/hooks/useReqoreMedia.js +33 -9
  114. package/dist/hooks/useReqoreMedia.js.map +1 -1
  115. package/dist/index.d.ts +4 -0
  116. package/dist/index.d.ts.map +1 -1
  117. package/dist/index.js +8 -3
  118. package/dist/index.js.map +1 -1
  119. package/package.json +1 -3
  120. package/tests.json +1 -0
  121. package/vitest.config.ts +40 -23
package/vitest.config.ts CHANGED
@@ -11,18 +11,25 @@ const dirname = path.dirname(fileURLToPath(import.meta.url));
11
11
  const qlipUploadToken = process.env.QLIP_UPLOAD_TOKEN;
12
12
 
13
13
  /**
14
- * Story files with no story tagged `touch`, relative to the project root. The touch project leaves them out,
15
- * so it does not load every story module only to skip it. Read from the files themselves: tagging a story
16
- * is all it takes to run it on a touch screen.
14
+ * Story files that cannot hold a story tagged `touch`, relative to the project root. The touch
15
+ * project leaves them out, so it does not load every story module only to skip it. Read from the
16
+ * files themselves: tagging a story is all it takes to run it on a touch screen.
17
+ *
18
+ * Both story projects split the stories by the tags Storybook reads from a story file's source
19
+ * before it runs it (`tags` below): string literals, in a `tags` array on a story or its meta, or
20
+ * in an array the file names there. So a file with no `'touch'` or `"touch"` in it has no story
21
+ * either project counts as tagged, and any other file is loaded here. Matching the shape of a
22
+ * `tags` line instead left out a file that tagged its stories another way Storybook reads
23
+ * (`tags: TOUCH`, a comment in the array): the desktop project left those stories out and this
24
+ * one never loaded them, so they ran nowhere and nothing failed. A file that only mentions the
25
+ * word costs a module load. A tag a story only has when it runs (spread into it from a shared
26
+ * object) is read from the source by neither project: `.storybook/vitest.setup.ts` fails it.
17
27
  */
18
28
  const storyFilesWithoutTouch = (): string[] =>
19
29
  readdirSync(path.join(dirname, 'src'), { recursive: true, encoding: 'utf8' })
20
30
  .filter((file) => file.endsWith('.stories.tsx'))
21
31
  .map((file) => path.join('src', file).split(path.sep).join('/'))
22
- .filter(
23
- (file) =>
24
- !/\btags:\s*\[[^\]]*['"]touch['"]/.test(readFileSync(path.join(dirname, file), 'utf8'))
25
- );
32
+ .filter((file) => !/['"]touch['"]/.test(readFileSync(path.join(dirname, file), 'utf8')));
26
33
 
27
34
  // One plugin for both story projects, so they make one qlip build: one build id, and one upload at the end
28
35
  // of the run (the plugin registers its reporter once, however many projects load it).
@@ -36,8 +43,12 @@ const qlip = qlipVitestPlugin({
36
43
  ...(qlipUploadToken ? { upload: { uploadToken: qlipUploadToken } } : {}),
37
44
  });
38
45
 
39
- // A new object for each project: Vitest names a project's browser instances on the objects themselves.
40
- const storyBrowser = () => ({
46
+ /**
47
+ * The browser a story project runs in: a desktop with a mouse, or - `phone` - the phone the stories tagged
48
+ * `touch` run on (`src/stories/utils/touchScreen.ts`). A new object for each project: Vitest names a
49
+ * project's browser instances on the objects themselves.
50
+ */
51
+ const storyBrowser = (phone = false) => ({
41
52
  enabled: true,
42
53
  // Vitest 4's @vitest/browser-playwright no longer applies
43
54
  // `browser.viewport` to the Playwright context (the line is
@@ -48,8 +59,17 @@ const storyBrowser = () => ({
48
59
  // viewport through the provider's `contextOptions` (which IS
49
60
  // applied) so the browser window matches qlip's capture viewport
50
61
  // 1:1 and screenshots come out at their true resolution.
62
+ //
63
+ // The phone is a phone from the start: Playwright makes its context with `isMobile` and `hasTouch`, so
64
+ // `(pointer: coarse)` and `(hover: none)` match and a touch is a finger's, and nothing turns that on or
65
+ // off. Turning Chromium's touch emulation off over the DevTools protocol (how a touch story used to
66
+ // borrow a desktop page) leaves the page with the hover and pointer the machine reports, not the mouse
67
+ // Playwright launched it with (`--blink-settings=primaryHoverType=2,…`), and a Linux CI runner reports
68
+ // none: every later story in the page found `(hover: none)` (qorus#646).
51
69
  provider: playwright({
52
- contextOptions: { viewport: { width: 1920, height: 1080 } },
70
+ contextOptions: phone
71
+ ? { viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true }
72
+ : { viewport: { width: 1920, height: 1080 } },
53
73
  }),
54
74
  headless: true,
55
75
  instances: [{ browser: 'chromium' as const }],
@@ -70,14 +90,9 @@ export default mergeConfig(
70
90
  // Component/interaction tests: run every story in a real browser via Playwright.
71
91
  // Replaces the former @storybook/test-runner.
72
92
  //
73
- // Stories run in two projects, and so in two browser pages. A story tagged `touch` holds the page as a
74
- // phone (`withTouchScreen` in src/stories/utils/touchScreen.ts), and Chromium cannot hand that page back
75
- // as it was: turning its touch emulation off takes the hover and pointer the machine reports, not the
76
- // ones the browser was launched with. Playwright launches its headless Chromium as a mouse
77
- // (`--blink-settings=primaryHoverType=2,…,primaryPointerType=4`); a Linux runner reports no mouse, so in
78
- // CI every story after a touch story in the same page found `(hover: none)` - the hover-only actions
79
- // shown, the Marquee and NavRail deaf to hover, Table's row menu at the touch size. On a Mac the machine
80
- // reports a mouse, so the same run passes there.
93
+ // Stories run in two projects, each in a browser of its own kind (see `storyBrowser`): every story on
94
+ // a desktop with a mouse, but those tagged `touch`, which run on a phone. `.storybook/vitest.setup.ts`
95
+ // checks each story's browser is the one its project promises.
81
96
  {
82
97
  extends: true,
83
98
  plugins: [
@@ -90,12 +105,15 @@ export default mergeConfig(
90
105
  ],
91
106
  test: {
92
107
  name: 'storybook',
108
+ // after the stories on the phone: each story here checks it still has its mouse
109
+ sequence: { groupOrder: 1 },
93
110
  browser: storyBrowser(),
94
111
  ...storyTest,
95
112
  },
96
113
  },
97
- // The stories tagged `touch`, in their own page, after the others (one file at a time: the touch
98
- // screen and the narrowed frame belong to the page).
114
+ // The stories tagged `touch`, on the phone. Before the others, not beside them: the two projects share
115
+ // Storybook's dependency cache (it is named after the config directory), which is not built twice at
116
+ // once.
99
117
  {
100
118
  extends: true,
101
119
  plugins: [
@@ -109,9 +127,8 @@ export default mergeConfig(
109
127
  test: {
110
128
  name: 'storybook-touch',
111
129
  exclude: [...configDefaults.exclude, ...storyFilesWithoutTouch()],
112
- fileParallelism: false,
113
- sequence: { groupOrder: 1 },
114
- browser: storyBrowser(),
130
+ sequence: { groupOrder: 0 },
131
+ browser: storyBrowser(true),
115
132
  ...storyTest,
116
133
  },
117
134
  },