@ship-ui/core 0.18.13 → 0.19.1
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/assets/mcp/components.json +57 -34
- package/bin/ship-fg-scanner +0 -0
- package/bin/ship-fg.mjs +3588 -0
- package/bin/ship-fg.ts +1 -2
- package/bin/src/scanner.zig +322 -0
- package/bin/src/ship-fg.ts +101 -183
- package/bin/src/subset.ts +97 -0
- package/bin/src/utilities.js +19 -19
- package/bin/src/utilities.ts +19 -19
- package/fesm2022/ship-ui-core.mjs +518 -331
- package/fesm2022/ship-ui-core.mjs.map +1 -1
- package/package.json +6 -5
- package/snippets/ship-ui.code-snippets +0 -7
- package/styles/components/ship-sidenav.scss +1 -1
- package/styles/components/ship-sortable.scss +13 -22
- package/types/ship-ui-core.d.ts +78 -46
- package/bin/ship-fg-node +0 -40
- package/bin/src/ship-fg-node.js +0 -373
|
@@ -172,13 +172,34 @@
|
|
|
172
172
|
"name": "ShipSortable",
|
|
173
173
|
"selector": "[shSortable]",
|
|
174
174
|
"path": "core/projects/ship-ui/src/lib/ship-sortable/ship-sortable.ts",
|
|
175
|
-
"description": "### Enable Sorting\n\nApply the\n`shSortable`\ndirective to a\n`sh-list`\nor any container element to enable drag-and-drop reordering.\n\n### Event Handling\n\nListen to the\n`
|
|
176
|
-
"inputs": [
|
|
175
|
+
"description": "### Enable Sorting\n\nApply the\n`shSortable`\ndirective to a\n`sh-list`\nor any container element to enable drag-and-drop reordering.\n\n### Event Handling\n\nListen to the\n`sortDrop`\nevent to update your data source when an item is moved. For complex implementations, skip events and use the\n`SortableManager`\n(see below).\n\n### Sortable Manager (Recommended)\n\nVastly simplify drag-and-drop state by passing a unified manager to the\n`shSortable`\ninput. Pass a dictionary of signals to\n`createSortableManager()`\n, and bind it using\n`[shSortable]=\"manager\" sortableGroup=\"listId\"`\n. For single lists, simply use\n`[shSortable]=\"manager\"`\n. You can even provide an\n`onBeforeDrop`\nhook to await an API request (Promise or RxJS Observable) before accepting the drop automatically!\n\n### Handles\n\nAdd the\n`sort-handle`\nattribute to a specific element within a sortable item to limit dragging to that specific area.",
|
|
176
|
+
"inputs": [
|
|
177
|
+
{
|
|
178
|
+
"name": "shSortable",
|
|
179
|
+
"type": "any",
|
|
180
|
+
"description": ""
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"name": "sortableGroup",
|
|
184
|
+
"type": "string",
|
|
185
|
+
"description": ""
|
|
186
|
+
}
|
|
187
|
+
],
|
|
177
188
|
"outputs": [
|
|
189
|
+
{
|
|
190
|
+
"name": "sortDrop",
|
|
191
|
+
"type": "ShipDropEvent",
|
|
192
|
+
"description": ""
|
|
193
|
+
},
|
|
178
194
|
{
|
|
179
195
|
"name": "afterDrop",
|
|
180
196
|
"type": "AfterDropResponse",
|
|
181
197
|
"description": ""
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"name": "crossDrop",
|
|
201
|
+
"type": "CrossDropResponse",
|
|
202
|
+
"description": ""
|
|
182
203
|
}
|
|
183
204
|
],
|
|
184
205
|
"methods": [
|
|
@@ -194,12 +215,30 @@
|
|
|
194
215
|
"returnType": "any",
|
|
195
216
|
"description": ""
|
|
196
217
|
},
|
|
218
|
+
{
|
|
219
|
+
"name": "dragEnter",
|
|
220
|
+
"parameters": "e: DragEvent",
|
|
221
|
+
"returnType": "any",
|
|
222
|
+
"description": ""
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"name": "dragLeave",
|
|
226
|
+
"parameters": "e: DragEvent",
|
|
227
|
+
"returnType": "any",
|
|
228
|
+
"description": ""
|
|
229
|
+
},
|
|
197
230
|
{
|
|
198
231
|
"name": "dragOver",
|
|
199
232
|
"parameters": "e: DragEvent",
|
|
200
233
|
"returnType": "any",
|
|
201
234
|
"description": ""
|
|
202
235
|
},
|
|
236
|
+
{
|
|
237
|
+
"name": "getVisualIndexOfElement",
|
|
238
|
+
"parameters": "i: number",
|
|
239
|
+
"returnType": "number",
|
|
240
|
+
"description": ""
|
|
241
|
+
},
|
|
203
242
|
{
|
|
204
243
|
"name": "drop",
|
|
205
244
|
"parameters": "",
|
|
@@ -217,44 +256,28 @@
|
|
|
217
256
|
"examples": [
|
|
218
257
|
{
|
|
219
258
|
"name": "base-sortable",
|
|
220
|
-
"html": "<sh-list shSortable
|
|
221
|
-
"ts": "import { ChangeDetectionStrategy, Component, signal } from '@angular/core';\nimport {
|
|
222
|
-
}
|
|
223
|
-
]
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
"name": "GridSortable",
|
|
227
|
-
"selector": "[shGridSortable]",
|
|
228
|
-
"path": "core/projects/ship-ui/src/lib/ship-sortable/grid-sortable.ts",
|
|
229
|
-
"description": "### Enable Sorting\n\nApply the\n`shSortable`\ndirective to a\n`sh-list`\nor any container element to enable drag-and-drop reordering.\n\n### Event Handling\n\nListen to the\n`afterDrop`\nevent to update your data source when an item is moved:\n`(afterDrop)=\"reorder($event)\"`\n.\n\n### Handles\n\nAdd the\n`sort-handle`\nattribute to a specific element within a sortable item to limit dragging to that specific area.",
|
|
230
|
-
"inputs": [],
|
|
231
|
-
"outputs": [],
|
|
232
|
-
"methods": [
|
|
259
|
+
"html": "<sh-list [shSortable]=\"manager\">\n @for (todo of todos(); track $index) {\n <div item [draggable]=\"true\" [class.active]=\"todo.done\" (click)=\"toggleTodo($index)\">\n <sh-checkbox [checked]=\"todo.done\" class=\"primary raised\" />\n\n @if (todo.done) {\n <s>{{ todo.title }}</s>\n } @else {\n {{ todo.title }}\n }\n </div>\n }\n</sh-list>\n",
|
|
260
|
+
"ts": "import { ChangeDetectionStrategy, Component, signal } from '@angular/core';\nimport { createSortableManager, ShipCheckbox, ShipList, ShipSortable } from 'ship-ui';\n\nconst TODOS = [\n {\n title: 'Simple sorting of list',\n done: true,\n },\n {\n title: 'Sorting animation',\n done: true,\n },\n {\n title: 'Support sortable handle',\n done: true,\n },\n {\n title: 'Support gap in sorting list ',\n done: true,\n },\n {\n title: 'Support placeholder',\n done: true,\n },\n {\n title: 'Support animation only when dragging',\n done: true,\n },\n {\n title: 'Support multiple lists',\n done: false,\n },\n {\n title: 'Support draggable grids',\n done: false,\n },\n];\n\ntype Todo = (typeof TODOS)[0];\n\n@Component({\n selector: 'app-base-sortable',\n standalone: true,\n imports: [ShipList, ShipSortable, ShipCheckbox],\n templateUrl: './base-sortable.html',\n styleUrl: './base-sortable.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BaseSortable {\n todos = signal(TODOS);\n manager = createSortableManager(this.todos);\n\n toggleTodo(index: number) {\n this.todos.update((todos) => {\n todos[index].done = !todos[index].done;\n\n return todos;\n });\n }\n}\n"
|
|
261
|
+
},
|
|
233
262
|
{
|
|
234
|
-
"name": "
|
|
235
|
-
"
|
|
236
|
-
"
|
|
237
|
-
"description": ""
|
|
263
|
+
"name": "cross-list-sortable",
|
|
264
|
+
"html": "<div class=\"board\">\n <sh-card class=\"column\">\n <h3>To Do</h3>\n <div [shSortable]=\"manager\" sortableGroup=\"todo\" class=\"sortable-list\">\n @for (item of todoList(); track item; let i = $index) {\n <div class=\"item\" draggable=\"true\">\n {{ item }}\n </div>\n }\n </div>\n </sh-card>\n\n <sh-card class=\"column\">\n <h3>In Progress</h3>\n <div [shSortable]=\"manager\" sortableGroup=\"inProgress\" class=\"sortable-list\">\n @for (item of inProgressList(); track item; let i = $index) {\n <div class=\"item\" draggable=\"true\">\n {{ item }}\n </div>\n }\n </div>\n </sh-card>\n\n <sh-card class=\"column\">\n <h3>Done</h3>\n <div [shSortable]=\"manager\" sortableGroup=\"done\" class=\"sortable-list\">\n @for (item of doneList(); track item; let i = $index) {\n <div class=\"item\" draggable=\"true\">\n {{ item }}\n </div>\n }\n </div>\n </sh-card>\n</div>\n",
|
|
265
|
+
"ts": "import { ChangeDetectionStrategy, Component, signal } from '@angular/core';\nimport { createSortableManager, ShipCard, ShipSortable } from 'ship-ui';\n\n@Component({\n selector: 'app-cross-list-sortable',\n standalone: true,\n imports: [ShipSortable, ShipCard],\n templateUrl: './cross-list-sortable.html',\n styleUrl: './cross-list-sortable.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CrossListSortable {\n todoList = signal(['Implement Grids', 'Implement multiple boards', 'Refactor drag drop core']);\n inProgressList = signal(['Write implementation plan', 'Check examples']);\n doneList = signal(['Read documentation', 'Setup ship-ui workspace']);\n\n manager = createSortableManager({\n todo: this.todoList,\n inProgress: this.inProgressList,\n done: this.doneList,\n });\n}\n"
|
|
238
266
|
},
|
|
239
267
|
{
|
|
240
|
-
"name": "
|
|
241
|
-
"
|
|
242
|
-
"
|
|
243
|
-
"description": ""
|
|
268
|
+
"name": "mixed-size-sortable",
|
|
269
|
+
"html": "<div class=\"mixed-list\" [shSortable]=\"manager\">\n @for (item of items(); track item.id) {\n <div class=\"item\" [draggable]=\"true\" [class]=\"item.size\">\n {{ item.text }}\n </div>\n }\n</div>\n",
|
|
270
|
+
"ts": "import { ChangeDetectionStrategy, Component, signal } from '@angular/core';\nimport { createSortableManager, ShipSortable } from 'ship-ui';\n\nconst ITEMS = [\n { id: 1, text: 'Small item', size: 'small' },\n { id: 2, text: 'This is a much larger item that spans multiple lines to show off the fact that the sortable handles differently sized elements cleanly.', size: 'large' },\n { id: 3, text: 'Medium item with a bit more content.', size: 'medium' },\n { id: 4, text: 'Another small item', size: 'small' },\n { id: 5, text: 'Massive item. Huge block of text here to make it really tall. '.repeat(3), size: 'extra-large' },\n];\n\n@Component({\n selector: 'app-mixed-size-sortable',\n standalone: true,\n imports: [ShipSortable],\n templateUrl: './mixed-size-sortable.html',\n styleUrl: './mixed-size-sortable.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MixedSizeSortable {\n items = signal(ITEMS);\n manager = createSortableManager(this.items);\n}\n"
|
|
244
271
|
},
|
|
245
272
|
{
|
|
246
|
-
"name": "
|
|
247
|
-
"
|
|
248
|
-
"
|
|
249
|
-
|
|
250
|
-
}
|
|
251
|
-
],
|
|
252
|
-
"cssVariables": [],
|
|
253
|
-
"examples": [
|
|
273
|
+
"name": "grid-sortable",
|
|
274
|
+
"html": "<div class=\"grid-container\" [shSortable]=\"manager\">\n @for (item of items(); track item) {\n <div class=\"grid-item\" draggable=\"true\">\n {{ item }}\n </div>\n }\n</div>\n",
|
|
275
|
+
"ts": "import { ChangeDetectionStrategy, Component, signal } from '@angular/core';\nimport { createSortableManager, ShipSortable } from 'ship-ui';\n\n@Component({\n selector: 'app-grid-sortable-example',\n standalone: true,\n imports: [ShipSortable],\n templateUrl: './grid-sortable-example.html',\n styleUrl: './grid-sortable-example.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GridSortableExample {\n items = signal(Array.from({ length: 12 }, (_, i) => `Item ${i + 1}`));\n\n\n manager = createSortableManager(this.items);\n}\n"
|
|
276
|
+
},
|
|
254
277
|
{
|
|
255
|
-
"name": "
|
|
256
|
-
"html": "<sh-list shSortable
|
|
257
|
-
"ts": "import { ChangeDetectionStrategy, Component, signal } from '@angular/core';\nimport {
|
|
278
|
+
"name": "handle-sortable",
|
|
279
|
+
"html": "<sh-list [shSortable]=\"manager\">\n @for (item of items(); track item) {\n <div class=\"list-item\" draggable=\"true\">\n <div class=\"drag-handle\" sort-handle>\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"9\" cy=\"12\" r=\"1\"></circle>\n <circle cx=\"9\" cy=\"5\" r=\"1\"></circle>\n <circle cx=\"9\" cy=\"19\" r=\"1\"></circle>\n <circle cx=\"15\" cy=\"12\" r=\"1\"></circle>\n <circle cx=\"15\" cy=\"5\" r=\"1\"></circle>\n <circle cx=\"15\" cy=\"19\" r=\"1\"></circle>\n </svg>\n </div>\n <div class=\"content\">{{ item }}</div>\n </div>\n }\n</sh-list>\n",
|
|
280
|
+
"ts": "import { ChangeDetectionStrategy, Component, signal } from '@angular/core';\nimport { createSortableManager, ShipList, ShipSortable } from 'ship-ui';\n\n@Component({\n selector: 'app-handle-sortable',\n standalone: true,\n imports: [ShipList, ShipSortable],\n templateUrl: './handle-sortable.html',\n styleUrl: './handle-sortable.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class HandleSortable {\n items = signal(['Task 1: Design Review', 'Task 2: Build Sortables', 'Task 3: Drag Handles', 'Task 4: Publish SDK', 'Task 5: Profit']);\n manager = createSortableManager(this.items);\n}\n"
|
|
258
281
|
}
|
|
259
282
|
]
|
|
260
283
|
},
|
|
Binary file
|