@jsenv/navi 0.0.1 → 0.1.0
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/jsenv_navi.js +22954 -0
- package/index.js +66 -16
- package/package.json +22 -11
- package/src/actions.js +50 -26
- package/src/browser_integration/browser_integration.js +31 -6
- package/src/browser_integration/via_history.js +42 -9
- package/src/components/action_execution/render_actionable_component.jsx +6 -4
- package/src/components/action_execution/use_action.js +51 -282
- package/src/components/action_execution/use_execute_action.js +106 -92
- package/src/components/action_execution/use_run_on_mount.js +9 -0
- package/src/components/action_renderer.jsx +21 -32
- package/src/components/demos/0_button_demo.html +574 -103
- package/src/components/demos/10_column_reordering_debug.html +277 -0
- package/src/components/demos/11_table_selection_debug.html +432 -0
- package/src/components/demos/1_checkbox_demo.html +579 -202
- package/src/components/demos/2_input_textual_demo.html +81 -138
- package/src/components/demos/3_radio_demo.html +0 -2
- package/src/components/demos/4_select_demo.html +19 -23
- package/src/components/demos/6_tablist_demo.html +77 -0
- package/src/components/demos/7_table_selection_demo.html +176 -0
- package/src/components/demos/8_table_fixed_headers_demo.html +584 -0
- package/src/components/demos/9_table_column_drag_demo.html +325 -0
- package/src/components/demos/action/0_button_demo.html +2 -4
- package/src/components/demos/action/1_input_text_demo.html +643 -222
- package/src/components/demos/action/3_details_demo.html +146 -115
- package/src/components/demos/action/4_input_checkbox_demo.html +442 -322
- package/src/components/demos/action/5_input_checkbox_state_demo.html +270 -0
- package/src/components/demos/action/6_checkbox_list_demo.html +304 -72
- package/src/components/demos/action/7_radio_list_demo.html +310 -170
- package/src/components/demos/action/{8_editable_text_demo.html → 8_editable_demo.html} +65 -76
- package/src/components/demos/action/9_link_demo.html +84 -62
- package/src/components/demos/ui_transition/0_action_renderer_ui_transition_demo.html +695 -0
- package/src/components/demos/ui_transition/1_nested_ui_transition_demo.html +429 -0
- package/src/components/demos/ui_transition/2_height_transition_test.html +295 -0
- package/src/components/details/details.jsx +62 -64
- package/src/components/edition/editable.jsx +186 -0
- package/src/components/field/README.md +247 -0
- package/src/components/{input → field}/button.jsx +151 -130
- package/src/components/field/checkbox_list.jsx +184 -0
- package/src/components/{collect_form_element_values.js → field/collect_form_element_values.js} +7 -4
- package/src/components/{input → field}/field_css.js +4 -1
- package/src/components/field/form.jsx +211 -0
- package/src/components/{input → field}/input.jsx +1 -0
- package/src/components/{input → field}/input_checkbox.jsx +132 -155
- package/src/components/{input → field}/input_radio.jsx +135 -46
- package/src/components/{input → field}/input_textual.jsx +247 -173
- package/src/components/field/label.jsx +32 -0
- package/src/components/field/radio_list.jsx +182 -0
- package/src/components/{input → field}/select.jsx +17 -32
- package/src/components/field/use_action_events.js +132 -0
- package/src/components/field/use_form_events.js +55 -0
- package/src/components/field/use_ui_state_controller.js +506 -0
- package/src/components/item_tracker/README.md +461 -0
- package/src/components/item_tracker/use_isolated_item_tracker.jsx +209 -0
- package/src/components/item_tracker/use_isolated_item_tracker_demo.html +148 -0
- package/src/components/item_tracker/use_isolated_item_tracker_demo.jsx +460 -0
- package/src/components/item_tracker/use_item_tracker.jsx +143 -0
- package/src/components/item_tracker/use_item_tracker_demo.html +207 -0
- package/src/components/item_tracker/use_item_tracker_demo.jsx +216 -0
- package/src/components/keyboard_shortcuts/active_keyboard_shortcuts.jsx +87 -0
- package/src/components/keyboard_shortcuts/aria_key_shortcuts.js +61 -0
- package/src/components/keyboard_shortcuts/keyboard_key_meta.js +17 -0
- package/src/components/keyboard_shortcuts/keyboard_shortcuts.js +371 -0
- package/src/components/link/link.jsx +65 -102
- package/src/components/link/link_with_icon.jsx +52 -0
- package/src/components/loader/loader_background.jsx +85 -64
- package/src/components/loader/rectangle_loading.jsx +38 -19
- package/src/components/route.jsx +8 -4
- package/src/components/selection/selection.jsx +1583 -0
- package/src/components/svg/font_sized_svg.jsx +45 -0
- package/src/components/svg/icon_and_text.jsx +21 -0
- package/src/components/svg/svg_mask_overlay.jsx +105 -0
- package/src/components/table/drag/table_drag.jsx +506 -0
- package/src/components/table/resize/table_resize.jsx +650 -0
- package/src/components/table/resize/table_size.js +43 -0
- package/src/components/table/selection/table_selection.js +106 -0
- package/src/components/table/selection/table_selection.jsx +203 -0
- package/src/components/table/sticky/sticky_group.js +354 -0
- package/src/components/table/sticky/table_sticky.js +25 -0
- package/src/components/table/sticky/table_sticky.jsx +501 -0
- package/src/components/table/table.jsx +721 -0
- package/src/components/table/table_css.js +211 -0
- package/src/components/table/table_ui.jsx +49 -0
- package/src/components/table/use_cells_and_columns.js +90 -0
- package/src/components/table/use_object_array_to_cells.js +46 -0
- package/src/components/table/z_indexes.js +23 -0
- package/src/components/tablist/tablist.jsx +99 -0
- package/src/components/text/overflow.jsx +15 -0
- package/src/components/text/text_and_count.jsx +28 -0
- package/src/components/ui_transition.jsx +128 -0
- package/src/components/use_auto_focus.js +58 -7
- package/src/components/use_batch_during_render.js +33 -0
- package/src/components/use_debounce_true.js +7 -7
- package/src/components/use_dependencies_diff.js +35 -0
- package/src/components/use_focus_group.js +4 -3
- package/src/components/use_initial_value.js +8 -34
- package/src/components/use_signal_sync.js +1 -1
- package/src/components/use_stable_callback.js +68 -0
- package/src/components/use_state_array.js +16 -9
- package/src/docs/actions.md +22 -0
- package/src/notes.md +33 -12
- package/src/route/route.js +97 -47
- package/src/store/resource_graph.js +2 -1
- package/src/store/tests/{resource_graph_dependencies.test.js → resource_graph_dependencies.test_manual.js} +13 -13
- package/src/utils/is_signal.js +20 -0
- package/src/utils/stringify_for_display.js +4 -23
- package/src/validation/constraints/confirm_constraint.js +14 -0
- package/src/validation/constraints/create_unique_value_constraint.js +27 -0
- package/src/validation/constraints/native_constraints.js +313 -0
- package/src/validation/constraints/readonly_constraint.js +36 -0
- package/src/validation/constraints/single_space_constraint.js +13 -0
- package/src/validation/custom_constraint_validation.js +599 -0
- package/src/validation/custom_message.js +18 -0
- package/src/validation/demos/browser_style.png +0 -0
- package/src/validation/demos/form_validation_demo.html +142 -0
- package/src/validation/demos/form_validation_demo_preact.html +87 -0
- package/src/validation/demos/form_validation_native_popover_demo.html +168 -0
- package/src/validation/demos/form_validation_vs_native_demo.html +172 -0
- package/src/validation/demos/validation_message_demo.html +203 -0
- package/src/validation/hooks/use_constraints.js +23 -0
- package/src/validation/hooks/use_custom_validation_ref.js +73 -0
- package/src/validation/hooks/use_validation_message.js +19 -0
- package/src/validation/validation_message.js +741 -0
- package/src/components/editable_text/editable_text.jsx +0 -96
- package/src/components/form.jsx +0 -144
- package/src/components/input/checkbox_list.jsx +0 -294
- package/src/components/input/field.jsx +0 -61
- package/src/components/input/radio_list.jsx +0 -283
- package/src/components/input/use_form_event.js +0 -20
- package/src/components/input/use_on_change.js +0 -12
- package/src/components/selection/selection.js +0 -5
- package/src/components/selection/selection_context.jsx +0 -262
- package/src/components/shortcut/shortcut_context.jsx +0 -390
- package/src/components/use_action_events.js +0 -37
- package/src/utils/iterable_weak_set.js +0 -62
- /package/src/components/demos/action/{11_nested_shortcuts_demo.html → 11_nested_shortcuts_demo.xhtml} +0 -0
- /package/src/components/{shortcut → keyboard_shortcuts}/os.js +0 -0
- /package/src/route/{route.test.html → route.xtest.html} +0 -0
|
@@ -24,130 +24,143 @@
|
|
|
24
24
|
return (
|
|
25
25
|
<>
|
|
26
26
|
<div style="display: flex; flex-direction: row; gap: 30px">
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<Details
|
|
32
|
-
id="test"
|
|
33
|
-
action={() => {
|
|
34
|
-
return "Hello";
|
|
35
|
-
}}
|
|
36
|
-
>
|
|
37
|
-
{(message) => <span>{message}</span>}
|
|
38
|
-
</Details>
|
|
39
|
-
</div>
|
|
27
|
+
<DetailsLoadSyncDemo />
|
|
28
|
+
<DetailsLoadAfter1sDemo />
|
|
29
|
+
<DetailsThrowSyncDemo />
|
|
30
|
+
</div>
|
|
40
31
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
id="test_2"
|
|
47
|
-
action={async () => {
|
|
48
|
-
await new Promise((resolve) => {
|
|
49
|
-
setTimeout(resolve, 1000);
|
|
50
|
-
});
|
|
51
|
-
return "Hello";
|
|
52
|
-
}}
|
|
53
|
-
label="Custom summary"
|
|
54
|
-
>
|
|
55
|
-
{(content) => content}
|
|
56
|
-
</Details>
|
|
57
|
-
</div>
|
|
32
|
+
<DetailsFullControlDemo />
|
|
33
|
+
<DetailsWithActionPreloadedDemo />
|
|
34
|
+
</>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
58
37
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
38
|
+
// eslint-disable-next-line no-unused-vars
|
|
39
|
+
const DetailsLoadSyncDemo = () => {
|
|
40
|
+
return (
|
|
41
|
+
<div>
|
|
42
|
+
<p>
|
|
43
|
+
<strong>Loaded sync</strong>
|
|
44
|
+
</p>
|
|
45
|
+
<Details
|
|
46
|
+
id="test"
|
|
47
|
+
action={() => {
|
|
48
|
+
return "Hello";
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
{(message) => <span>{message}</span>}
|
|
52
|
+
</Details>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// eslint-disable-next-line no-unused-vars
|
|
58
|
+
const DetailsLoadAfter1sDemo = () => {
|
|
59
|
+
return (
|
|
60
|
+
<div>
|
|
61
|
+
<p>
|
|
62
|
+
<strong>Loaded after 1s</strong>
|
|
63
|
+
</p>
|
|
64
|
+
<Details
|
|
65
|
+
id="test_2"
|
|
66
|
+
action={async () => {
|
|
67
|
+
await new Promise((resolve) => {
|
|
68
|
+
setTimeout(resolve, 1000);
|
|
69
|
+
});
|
|
70
|
+
return "Hello";
|
|
71
|
+
}}
|
|
72
|
+
label="Custom summary"
|
|
73
|
+
>
|
|
74
|
+
{(content) => content}
|
|
75
|
+
</Details>
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// eslint-disable-next-line no-unused-vars
|
|
81
|
+
const DetailsThrowSyncDemo = () => {
|
|
82
|
+
return (
|
|
83
|
+
<div>
|
|
84
|
+
<p>
|
|
85
|
+
<strong>Throw sync</strong>
|
|
86
|
+
</p>
|
|
87
|
+
<Details
|
|
88
|
+
// id="test_3"
|
|
89
|
+
action={() => {
|
|
90
|
+
throw new Error("error");
|
|
91
|
+
}}
|
|
92
|
+
label={
|
|
93
|
+
<>
|
|
94
|
+
<span>A</span>
|
|
95
|
+
<span style="font-weight: bold">mixed summary</span>
|
|
96
|
+
</>
|
|
97
|
+
}
|
|
98
|
+
></Details>
|
|
99
|
+
</div>
|
|
100
|
+
);
|
|
101
|
+
};
|
|
77
102
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
103
|
+
// eslint-disable-next-line no-unused-vars
|
|
104
|
+
const DetailsFullControlDemo = () => {
|
|
105
|
+
return (
|
|
106
|
+
<div>
|
|
107
|
+
<p>
|
|
108
|
+
<strong>Full control (abort, reload)</strong>
|
|
109
|
+
</p>
|
|
110
|
+
<Details
|
|
111
|
+
id="test_4"
|
|
112
|
+
action={async (_, { signal }) => {
|
|
113
|
+
await new Promise((resolve) => {
|
|
114
|
+
const timeout = setTimeout(resolve, 1000);
|
|
115
|
+
signal.addEventListener("abort", () => {
|
|
116
|
+
clearTimeout(timeout);
|
|
90
117
|
});
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
onClick={() => {
|
|
101
|
-
action.abort();
|
|
102
|
-
}}
|
|
103
|
-
>
|
|
104
|
-
Abort
|
|
105
|
-
</button>
|
|
106
|
-
</span>
|
|
107
|
-
);
|
|
108
|
-
},
|
|
109
|
-
aborted: (action) => (
|
|
110
|
-
<>
|
|
111
|
-
<span style="color: red">Aborted</span>
|
|
118
|
+
});
|
|
119
|
+
return "Hello";
|
|
120
|
+
}}
|
|
121
|
+
>
|
|
122
|
+
{{
|
|
123
|
+
loading: (action) => {
|
|
124
|
+
return (
|
|
125
|
+
<span>
|
|
126
|
+
Loading...
|
|
112
127
|
<button
|
|
113
128
|
onClick={() => {
|
|
114
|
-
action.
|
|
129
|
+
action.abort();
|
|
115
130
|
}}
|
|
116
131
|
>
|
|
117
|
-
|
|
132
|
+
Abort
|
|
118
133
|
</button>
|
|
119
|
-
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
</div>
|
|
150
|
-
</>
|
|
134
|
+
</span>
|
|
135
|
+
);
|
|
136
|
+
},
|
|
137
|
+
aborted: (action) => (
|
|
138
|
+
<>
|
|
139
|
+
<span style="color: red">Aborted</span>
|
|
140
|
+
<button
|
|
141
|
+
onClick={() => {
|
|
142
|
+
action.rerun();
|
|
143
|
+
}}
|
|
144
|
+
>
|
|
145
|
+
Reload
|
|
146
|
+
</button>
|
|
147
|
+
</>
|
|
148
|
+
),
|
|
149
|
+
completed: (message, action) => (
|
|
150
|
+
<>
|
|
151
|
+
<span>{message}</span>
|
|
152
|
+
<button
|
|
153
|
+
onClick={() => {
|
|
154
|
+
action.rerun();
|
|
155
|
+
}}
|
|
156
|
+
>
|
|
157
|
+
Reload
|
|
158
|
+
</button>
|
|
159
|
+
</>
|
|
160
|
+
),
|
|
161
|
+
}}
|
|
162
|
+
</Details>
|
|
163
|
+
</div>
|
|
151
164
|
);
|
|
152
165
|
};
|
|
153
166
|
|
|
@@ -165,6 +178,24 @@
|
|
|
165
178
|
// name: "dam",
|
|
166
179
|
// });
|
|
167
180
|
rootAction.prerun();
|
|
181
|
+
// eslint-disable-next-line no-unused-vars
|
|
182
|
+
const DetailsWithActionPreloadedDemo = () => {
|
|
183
|
+
return (
|
|
184
|
+
<div>
|
|
185
|
+
<p>
|
|
186
|
+
<strong>Action preloaded</strong>
|
|
187
|
+
</p>
|
|
188
|
+
|
|
189
|
+
<Details
|
|
190
|
+
id="bound"
|
|
191
|
+
action={rootAction}
|
|
192
|
+
label="Action using bind params"
|
|
193
|
+
>
|
|
194
|
+
{(content) => content}
|
|
195
|
+
</Details>
|
|
196
|
+
</div>
|
|
197
|
+
);
|
|
198
|
+
};
|
|
168
199
|
|
|
169
200
|
render(<App />, document.querySelector("#root"));
|
|
170
201
|
</script>
|