@dxos/plugin-navtree 0.7.5-labs.e27f9b9 → 0.7.5-main.2567c87
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/dist/lib/browser/{app-graph-builder-BL7LRXCM.mjs → app-graph-builder-OF4MMBLH.mjs} +5 -7
- package/dist/lib/browser/{app-graph-builder-BL7LRXCM.mjs.map → app-graph-builder-OF4MMBLH.mjs.map} +3 -3
- package/dist/lib/browser/chunk-IMGT2LAL.mjs +658 -0
- package/dist/lib/browser/chunk-IMGT2LAL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-AOAGODQB.mjs → chunk-OI7AAA6Q.mjs} +1 -1
- package/dist/lib/browser/chunk-OI7AAA6Q.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +26 -21
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-74JPWYBP.mjs +42 -0
- package/dist/lib/browser/intent-resolver-74JPWYBP.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-6QWXI53A.mjs +189 -0
- package/dist/lib/browser/react-surface-6QWXI53A.mjs.map +7 -0
- package/dist/lib/browser/{state-65TQKYX7.mjs → state-HT65TAYL.mjs} +9 -6
- package/dist/lib/browser/state-HT65TAYL.mjs.map +7 -0
- package/dist/types/src/NavTreePlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +22 -22
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +2 -3
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +32 -88
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +3 -3
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/CommandsDialog.d.ts.map +1 -1
- package/dist/types/src/components/CommandsTrigger.d.ts.map +1 -1
- package/dist/types/src/components/NavTree.d.ts +20 -3
- package/dist/types/src/components/NavTree.d.ts.map +1 -1
- package/dist/types/src/components/NavTree.stories.d.ts +2 -2
- package/dist/types/src/components/NavTree.stories.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeContainer.d.ts +3 -4
- package/dist/types/src/components/NavTreeContainer.d.ts.map +1 -1
- package/dist/types/src/components/NavTreeFooter.d.ts +6 -0
- package/dist/types/src/components/NavTreeFooter.d.ts.map +1 -0
- package/dist/types/src/components/NavTreeItemAction.d.ts +1 -1
- package/dist/types/src/components/NavTreeItemAction.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/stories/Graph.stories.d.ts +2 -2
- package/dist/types/src/stories/Graph.stories.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +6 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +1 -2
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +0 -9
- package/dist/types/src/util.d.ts.map +1 -1
- package/package.json +31 -33
- package/src/NavTreePlugin.tsx +10 -8
- package/src/capabilities/app-graph-builder.ts +4 -6
- package/src/capabilities/capabilities.ts +2 -3
- package/src/capabilities/intent-resolver.ts +16 -22
- package/src/capabilities/react-surface.tsx +41 -15
- package/src/capabilities/state.ts +8 -5
- package/src/components/CommandsDialog.tsx +4 -3
- package/src/components/CommandsTrigger.tsx +5 -7
- package/src/components/NavTree.stories.tsx +5 -5
- package/src/components/NavTree.tsx +116 -26
- package/src/components/NavTreeContainer.tsx +32 -106
- package/src/components/NavTreeFooter.tsx +161 -0
- package/src/components/NavTreeItemAction.tsx +4 -12
- package/src/components/NotchStart.tsx +2 -2
- package/src/components/index.ts +0 -2
- package/src/stories/Graph.stories.tsx +4 -5
- package/src/translations.ts +6 -0
- package/src/types.ts +1 -2
- package/src/util.ts +0 -54
- package/dist/lib/browser/chunk-54MPRXMH.mjs +0 -1109
- package/dist/lib/browser/chunk-54MPRXMH.mjs.map +0 -7
- package/dist/lib/browser/chunk-AOAGODQB.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-U25VBFH3.mjs +0 -47
- package/dist/lib/browser/intent-resolver-U25VBFH3.mjs.map +0 -7
- package/dist/lib/browser/react-surface-LNRTNSM6.mjs +0 -57
- package/dist/lib/browser/react-surface-LNRTNSM6.mjs.map +0 -7
- package/dist/lib/browser/state-65TQKYX7.mjs.map +0 -7
- package/dist/types/src/components/L0Menu.d.ts +0 -9
- package/dist/types/src/components/L0Menu.d.ts.map +0 -1
- package/dist/types/src/components/L1Panels.d.ts +0 -8
- package/dist/types/src/components/L1Panels.d.ts.map +0 -1
- package/dist/types/src/components/NavTreeContext.d.ts +0 -4
- package/dist/types/src/components/NavTreeContext.d.ts.map +0 -1
- package/dist/types/src/components/NavTreeItemColumns.d.ts +0 -4
- package/dist/types/src/components/NavTreeItemColumns.d.ts.map +0 -1
- package/dist/types/src/components/types.d.ts +0 -25
- package/dist/types/src/components/types.d.ts.map +0 -1
- package/dist/types/src/hooks.d.ts +0 -3
- package/dist/types/src/hooks.d.ts.map +0 -1
- package/dist/types/src/stories/StorybookNavTree.d.ts +0 -4
- package/dist/types/src/stories/StorybookNavTree.d.ts.map +0 -1
- package/src/components/L0Menu.tsx +0 -210
- package/src/components/L1Panels.tsx +0 -100
- package/src/components/NavTreeContext.tsx +0 -13
- package/src/components/NavTreeItemColumns.tsx +0 -71
- package/src/components/types.ts +0 -33
- package/src/hooks.ts +0 -21
- package/src/stories/StorybookNavTree.tsx +0 -63
package/src/util.ts
CHANGED
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
ACTION_TYPE,
|
|
11
11
|
ACTION_GROUP_TYPE,
|
|
12
12
|
isAction,
|
|
13
|
-
isActionLike,
|
|
14
13
|
} from '@dxos/app-graph';
|
|
15
14
|
import { nonNullable } from '@dxos/util';
|
|
16
15
|
|
|
@@ -127,56 +126,3 @@ export const expandChildren = (graph: Graph, node: Node) => {
|
|
|
127
126
|
export const expandActions = (graph: Graph, node: Node) => {
|
|
128
127
|
return Promise.all([graph.expand(node, 'outbound', ACTION_TYPE), graph.expand(node, 'outbound', ACTION_GROUP_TYPE)]);
|
|
129
128
|
};
|
|
130
|
-
|
|
131
|
-
export const l0ItemType = (item: Node<any>) => {
|
|
132
|
-
if (item.properties.disposition === 'collection') {
|
|
133
|
-
return 'collection';
|
|
134
|
-
} else if (isActionLike(item)) {
|
|
135
|
-
return 'action';
|
|
136
|
-
} else if (item.properties.disposition === 'navigation') {
|
|
137
|
-
return 'link';
|
|
138
|
-
} else {
|
|
139
|
-
return 'tab';
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
// Regular expression to match renderable characters
|
|
144
|
-
// Excludes control characters, combining marks, and other non-renderable characters
|
|
145
|
-
const renderableCharRegex =
|
|
146
|
-
/^(?![\p{Control}\p{Mark}\p{Separator}\p{Surrogate}\p{Unassigned}])[\p{L}\p{N}\p{P}\p{S}\p{Emoji}]$/u;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Returns the first two renderable characters from a string that are separated by non-word characters.
|
|
150
|
-
* Handles Unicode characters correctly.
|
|
151
|
-
*
|
|
152
|
-
* @param {string} label - The input string to process
|
|
153
|
-
* @returns {[string, string]} Array containing the two characters, or empty strings if not found
|
|
154
|
-
*/
|
|
155
|
-
export const getFirstTwoRenderableChars = (label: string) => {
|
|
156
|
-
// Convert string to array of Unicode characters
|
|
157
|
-
const characters = Array.from(label);
|
|
158
|
-
|
|
159
|
-
// Keep track of found renderable characters
|
|
160
|
-
const result = ['', ''];
|
|
161
|
-
let foundFirst = false;
|
|
162
|
-
|
|
163
|
-
for (let i = 0; i < characters.length; i++) {
|
|
164
|
-
const char = characters[i];
|
|
165
|
-
|
|
166
|
-
if (renderableCharRegex.test(char)) {
|
|
167
|
-
if (!foundFirst) {
|
|
168
|
-
result[0] = char;
|
|
169
|
-
foundFirst = true;
|
|
170
|
-
} else {
|
|
171
|
-
// Check if there's at least one non-word character between the first and current char
|
|
172
|
-
const textBetween = characters.slice(result[0].length, i).join('');
|
|
173
|
-
if (/[^\p{L}\p{N}_]/u.test(textBetween)) {
|
|
174
|
-
result[1] = char;
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return result;
|
|
182
|
-
};
|