@molecule/app-related-items-card-svelte 0.0.0-stage → 1.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/LICENSE +202 -0
- package/README.md +137 -2
- package/dist/RelatedItemsCard.svelte +69 -0
- package/dist/RelatedItemsCard.svelte.d.ts +26 -0
- package/dist/RelatedItemsCard.svelte.d.ts.map +1 -0
- package/dist/components.d.ts +8 -0
- package/dist/components.d.ts.map +1 -0
- package/dist/components.js +7 -0
- package/dist/dom.d.ts +32 -0
- package/dist/dom.d.ts.map +1 -0
- package/dist/dom.js +31 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +61 -0
- package/dist/node-prop.d.ts +12 -0
- package/dist/node-prop.d.ts.map +1 -0
- package/dist/node-prop.js +6 -0
- package/dist/types.d.ts +31 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/package.json +71 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,138 @@
|
|
|
1
|
-
|
|
1
|
+
<!--
|
|
2
|
+
AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
3
|
+
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
|
+
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
|
+
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
+
Generated: 2026-11-15T09:13:05.925Z
|
|
7
|
+
-->
|
|
2
8
|
|
|
3
|
-
|
|
9
|
+
# @molecule/app-related-items-card-svelte
|
|
10
|
+
|
|
11
|
+
Svelte card container for cross-linked / related item lists.
|
|
12
|
+
|
|
13
|
+
Exports `RelatedItemsCard` — the Svelte counterpart of
|
|
14
|
+
`@molecule/app-related-items-card-react`: a titled Card with header + list +
|
|
15
|
+
empty state + "View all" link, with the same props (React names) and the
|
|
16
|
+
same DOM for the same input. Use for "Company → Deals", "Contact → Notes",
|
|
17
|
+
"Ticket → Related Articles" panels.
|
|
18
|
+
|
|
19
|
+
Props: `title` (snippet or string), `items: T[]`, `renderItem(item, index)`
|
|
20
|
+
(a snippet with the item and its index), `icon?`, `onItemClick?(item, index)`
|
|
21
|
+
(rows become clickable), `emptyState?` (rendered when `items` is empty),
|
|
22
|
+
`viewAllHref?` (header "View all" link), `headerActions?` (right-aligned
|
|
23
|
+
header slot), `className?`, `dataMolId?`.
|
|
24
|
+
|
|
25
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
26
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
27
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
```svelte
|
|
32
|
+
<script lang="ts">
|
|
33
|
+
import { RelatedItemsCard } from '@molecule/app-related-items-card-svelte'
|
|
34
|
+
|
|
35
|
+
interface Article {
|
|
36
|
+
id: string
|
|
37
|
+
title: string
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let { articles, onOpen }: { articles: Article[]; onOpen: (id: string) => void } = $props()
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<RelatedItemsCard
|
|
44
|
+
title="Related Articles"
|
|
45
|
+
items={articles}
|
|
46
|
+
viewAllHref="/articles"
|
|
47
|
+
onItemClick={(article) => onOpen(article.id)}
|
|
48
|
+
>
|
|
49
|
+
{#snippet renderItem(article)}
|
|
50
|
+
<span>{article.title}</span>
|
|
51
|
+
{/snippet}
|
|
52
|
+
{#snippet emptyState()}
|
|
53
|
+
<p>No related articles yet.</p>
|
|
54
|
+
{/snippet}
|
|
55
|
+
</RelatedItemsCard>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Type
|
|
59
|
+
|
|
60
|
+
`feature`
|
|
61
|
+
|
|
62
|
+
## Installation
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npm install @molecule/app-related-items-card-svelte @molecule/app-svelte @molecule/app-ui @molecule/app-ui-svelte svelte
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## API
|
|
69
|
+
|
|
70
|
+
### Interfaces
|
|
71
|
+
|
|
72
|
+
#### `RelatedItemsCardProps`
|
|
73
|
+
|
|
74
|
+
Props accepted by the {@link RelatedItemsCard} component.
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
interface RelatedItemsCardProps<T> {
|
|
78
|
+
/** Card heading. A string renders as text; a node arrives as the same-named snippet. */
|
|
79
|
+
title: ReactNodeProp
|
|
80
|
+
/** Optional leading icon in the header; arrives as the same-named snippet. */
|
|
81
|
+
icon?: ReactNodeProp
|
|
82
|
+
/** Items to render. */
|
|
83
|
+
items: readonly T[]
|
|
84
|
+
/** Render function for each item; arrives as a snippet with the item and its index. */
|
|
85
|
+
renderItem: Snippet<[T, number]>
|
|
86
|
+
/** Called when an item row is clicked (if applicable). */
|
|
87
|
+
onItemClick?: (item: T, index: number) => void
|
|
88
|
+
/** Rendered when `items` is empty; arrives as the same-named snippet. */
|
|
89
|
+
emptyState?: ReactNodeProp
|
|
90
|
+
/** Optional "View all" link rendered in the header. */
|
|
91
|
+
viewAllHref?: string
|
|
92
|
+
/** Optional right-aligned header actions; arrives as the same-named snippet. */
|
|
93
|
+
headerActions?: ReactNodeProp
|
|
94
|
+
/** Extra classes on the Card. */
|
|
95
|
+
className?: string
|
|
96
|
+
/** `data-mol-id` for AI-agent selectors. */
|
|
97
|
+
dataMolId?: string
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Constants
|
|
102
|
+
|
|
103
|
+
#### `RelatedItemsCard`
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
const RelatedItemsCard: LegacyComponentType
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Injection Notes
|
|
110
|
+
|
|
111
|
+
### Requirements
|
|
112
|
+
|
|
113
|
+
Peer dependencies:
|
|
114
|
+
|
|
115
|
+
- `@molecule/app-svelte` ^3.5.0
|
|
116
|
+
- `@molecule/app-ui` ^1.0.1
|
|
117
|
+
- `@molecule/app-ui-svelte` ^1.1.0
|
|
118
|
+
- `svelte` ^5.0.0
|
|
119
|
+
|
|
120
|
+
### Runtime Dependencies
|
|
121
|
+
|
|
122
|
+
- `@molecule/app-svelte`
|
|
123
|
+
- `@molecule/app-ui`
|
|
124
|
+
- `@molecule/app-ui-svelte`
|
|
125
|
+
- `svelte`
|
|
126
|
+
|
|
127
|
+
- Requires a bonded ClassMap — call `setClassMap()` (e.g. with
|
|
128
|
+
`@molecule/app-ui-tailwind`) at startup or rendering throws.
|
|
129
|
+
- The "View all" label is hardcoded English in the React reference (not
|
|
130
|
+
routed through i18n) and is the same literal here; pass a translated link
|
|
131
|
+
via `headerActions` in localized apps.
|
|
132
|
+
- `onItemClick` rows are mouse-only `<li>` elements (no keyboard handler);
|
|
133
|
+
render a real `<button>`/`<a>` inside `renderItem` when keyboard access
|
|
134
|
+
matters.
|
|
135
|
+
- `viewAllHref` renders a plain `<a href>` (full page load in SPA routers);
|
|
136
|
+
use `headerActions` with your router's Link for client-side navigation.
|
|
137
|
+
- Node-valued props (`title`, `icon`, `emptyState`, `headerActions`) arrive
|
|
138
|
+
as snippets; strings render as text.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
RelatedItemsCard: the Svelte counterpart of
|
|
3
|
+
`@molecule/app-related-items-card-react`'s `RelatedItemsCard` — a titled Card
|
|
4
|
+
with header + list + empty state + "View all" link. Same props (React
|
|
5
|
+
names), same DOM for the same input: the header always renders both of its
|
|
6
|
+
inner rows, `items.length === 0` swaps the list for `emptyState`, and the
|
|
7
|
+
rows are mouse-only `<li>` elements when `onItemClick` is supplied (React's
|
|
8
|
+
own JSDoc asks callers to render a real button/link inside `renderItem` when
|
|
9
|
+
keyboard access matters). The "View all" label is the same literal English
|
|
10
|
+
the React package renders; it does not route that label through i18n.
|
|
11
|
+
-->
|
|
12
|
+
<script lang="ts" generics="T">
|
|
13
|
+
import { getClassMap } from '@molecule/app-ui'
|
|
14
|
+
import { Card } from '@molecule/app-ui-svelte'
|
|
15
|
+
|
|
16
|
+
import { rowClick } from './dom.js'
|
|
17
|
+
import type { ReactNodeProp } from './node-prop.js'
|
|
18
|
+
import type { RelatedItemsCardProps } from './types.js'
|
|
19
|
+
|
|
20
|
+
let {
|
|
21
|
+
title,
|
|
22
|
+
icon,
|
|
23
|
+
items,
|
|
24
|
+
renderItem,
|
|
25
|
+
onItemClick,
|
|
26
|
+
emptyState,
|
|
27
|
+
viewAllHref,
|
|
28
|
+
headerActions,
|
|
29
|
+
className,
|
|
30
|
+
dataMolId,
|
|
31
|
+
}: RelatedItemsCardProps<T> = $props()
|
|
32
|
+
|
|
33
|
+
const cm = $derived(getClassMap())
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
{#snippet node(
|
|
37
|
+
value: ReactNodeProp | undefined,
|
|
38
|
+
)}{#if typeof value === 'function'}{@render value()}{:else if value !== undefined && value !== ''}{value}{/if}{/snippet}
|
|
39
|
+
|
|
40
|
+
<Card {className} data-mol-id={dataMolId}>
|
|
41
|
+
<div class={cm.stack(3)}>
|
|
42
|
+
<header class={cm.flex({ justify: 'between', align: 'center', gap: 'sm' })}>
|
|
43
|
+
<div class={cm.flex({ align: 'center', gap: 'sm' })}>
|
|
44
|
+
{@render node(icon)}
|
|
45
|
+
<h3 class={cm.cn(cm.textSize('base'), cm.fontWeight('semibold'))}>{@render node(title)}</h3>
|
|
46
|
+
</div>
|
|
47
|
+
<div class={cm.flex({ align: 'center', gap: 'sm' })}>
|
|
48
|
+
{@render node(headerActions)}
|
|
49
|
+
{#if viewAllHref}
|
|
50
|
+
<a href={viewAllHref} class={cm.cn(cm.textSize('sm'), cm.link)}>View all</a>
|
|
51
|
+
{/if}
|
|
52
|
+
</div>
|
|
53
|
+
</header>
|
|
54
|
+
{#if items.length === 0}
|
|
55
|
+
{@render node(emptyState)}
|
|
56
|
+
{:else}
|
|
57
|
+
<ul class={cm.stack(2)}>
|
|
58
|
+
{#each items as item, i (i)}
|
|
59
|
+
<li
|
|
60
|
+
class={onItemClick ? cm.cursorPointer : undefined}
|
|
61
|
+
use:rowClick={{ onItemClick, item, index: i }}
|
|
62
|
+
>
|
|
63
|
+
{@render renderItem(item, i)}
|
|
64
|
+
</li>
|
|
65
|
+
{/each}
|
|
66
|
+
</ul>
|
|
67
|
+
{/if}
|
|
68
|
+
</div>
|
|
69
|
+
</Card>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { RelatedItemsCardProps } from './types.js';
|
|
2
|
+
declare function $$render<T>(): {
|
|
3
|
+
props: RelatedItemsCardProps<T>;
|
|
4
|
+
exports: {};
|
|
5
|
+
bindings: "";
|
|
6
|
+
slots: {};
|
|
7
|
+
events: {};
|
|
8
|
+
};
|
|
9
|
+
declare class __sveltets_Render<T> {
|
|
10
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
11
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
12
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
13
|
+
bindings(): "";
|
|
14
|
+
exports(): {};
|
|
15
|
+
}
|
|
16
|
+
interface $$IsomorphicComponent {
|
|
17
|
+
new <T>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
18
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
19
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
20
|
+
<T>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
21
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
22
|
+
}
|
|
23
|
+
declare const RelatedItemsCard: $$IsomorphicComponent;
|
|
24
|
+
type RelatedItemsCard<T> = InstanceType<typeof RelatedItemsCard<T>>;
|
|
25
|
+
export default RelatedItemsCard;
|
|
26
|
+
//# sourceMappingURL=RelatedItemsCard.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RelatedItemsCard.svelte.d.ts","sourceRoot":"","sources":["../src/RelatedItemsCard.svelte"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,iBAAS,QAAQ,CAAC,CAAC;WAyDU,qBAAqB,CAAC,CAAC,CAAC;;;;;EAA4E;AACjI,cAAM,iBAAiB,CAAC,CAAC;IACrB,KAAK,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAChD,MAAM,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAClD,KAAK,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAChD,QAAQ;IACR,OAAO;CACV;AAED,UAAU,qBAAqB;IAC3B,KAAK,CAAC,EAAE,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;KAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5X,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC3H,YAAY,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;CACjE;AACD,QAAA,MAAM,gBAAgB,EAAE,qBAAmC,CAAC;AAC1C,KAAK,gBAAgB,CAAC,CAAC,IAAI,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The package's components: one Svelte 5 component per React component in
|
|
3
|
+
* `@molecule/app-related-items-card-react`, under the same React name.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
export { default as RelatedItemsCard } from './RelatedItemsCard.svelte';
|
|
8
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAA"}
|
package/dist/dom.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM helpers for {@link RelatedItemsCard}: the row click wiring.
|
|
3
|
+
*
|
|
4
|
+
* React attaches `onClick` to each item `<li>` only when the caller supplied a
|
|
5
|
+
* handler (its JSDoc is explicit that the rows are mouse-only, with no keyboard
|
|
6
|
+
* affordance), so the listener is attached through a Svelte action instead of
|
|
7
|
+
* an `onclick` attribute: the reference markup intentionally carries no
|
|
8
|
+
* handler attribute.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
/** One row's click wiring. */
|
|
13
|
+
export interface RowClick<T> {
|
|
14
|
+
/** The caller's handler, absent for non-clickable rows. */
|
|
15
|
+
onItemClick?: (item: T, index: number) => void;
|
|
16
|
+
/** The row's item. */
|
|
17
|
+
item: T;
|
|
18
|
+
/** The row's index. */
|
|
19
|
+
index: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Svelte action keeping a row's click handler in sync with the caller's prop.
|
|
23
|
+
*
|
|
24
|
+
* @param node - The `<li>` the handler belongs to.
|
|
25
|
+
* @param params - The current handler and the row's item and index.
|
|
26
|
+
* @returns The action with an update that re-targets the same listener.
|
|
27
|
+
*/
|
|
28
|
+
export declare function rowClick<T>(node: HTMLElement, params: RowClick<T>): {
|
|
29
|
+
update: (next: RowClick<T>) => void;
|
|
30
|
+
destroy: () => void;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../src/dom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,8BAA8B;AAC9B,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9C,sBAAsB;IACtB,IAAI,EAAE,CAAC,CAAA;IACP,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAClB;IAAE,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAY9D"}
|
package/dist/dom.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM helpers for {@link RelatedItemsCard}: the row click wiring.
|
|
3
|
+
*
|
|
4
|
+
* React attaches `onClick` to each item `<li>` only when the caller supplied a
|
|
5
|
+
* handler (its JSDoc is explicit that the rows are mouse-only, with no keyboard
|
|
6
|
+
* affordance), so the listener is attached through a Svelte action instead of
|
|
7
|
+
* an `onclick` attribute: the reference markup intentionally carries no
|
|
8
|
+
* handler attribute.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Svelte action keeping a row's click handler in sync with the caller's prop.
|
|
14
|
+
*
|
|
15
|
+
* @param node - The `<li>` the handler belongs to.
|
|
16
|
+
* @param params - The current handler and the row's item and index.
|
|
17
|
+
* @returns The action with an update that re-targets the same listener.
|
|
18
|
+
*/
|
|
19
|
+
export function rowClick(node, params) {
|
|
20
|
+
let current = params;
|
|
21
|
+
const listener = () => current.onItemClick?.(current.item, current.index);
|
|
22
|
+
node.addEventListener('click', listener);
|
|
23
|
+
return {
|
|
24
|
+
update(next) {
|
|
25
|
+
current = next;
|
|
26
|
+
},
|
|
27
|
+
destroy() {
|
|
28
|
+
node.removeEventListener('click', listener);
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Svelte card container for cross-linked / related item lists.
|
|
3
|
+
*
|
|
4
|
+
* Exports `RelatedItemsCard` — the Svelte counterpart of
|
|
5
|
+
* `@molecule/app-related-items-card-react`: a titled Card with header + list +
|
|
6
|
+
* empty state + "View all" link, with the same props (React names) and the
|
|
7
|
+
* same DOM for the same input. Use for "Company → Deals", "Contact → Notes",
|
|
8
|
+
* "Ticket → Related Articles" panels.
|
|
9
|
+
*
|
|
10
|
+
* Props: `title` (snippet or string), `items: T[]`, `renderItem(item, index)`
|
|
11
|
+
* (a snippet with the item and its index), `icon?`, `onItemClick?(item, index)`
|
|
12
|
+
* (rows become clickable), `emptyState?` (rendered when `items` is empty),
|
|
13
|
+
* `viewAllHref?` (header "View all" link), `headerActions?` (right-aligned
|
|
14
|
+
* header slot), `className?`, `dataMolId?`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```svelte
|
|
18
|
+
* <script lang="ts">
|
|
19
|
+
* import { RelatedItemsCard } from '@molecule/app-related-items-card-svelte'
|
|
20
|
+
*
|
|
21
|
+
* interface Article {
|
|
22
|
+
* id: string
|
|
23
|
+
* title: string
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* let { articles, onOpen }: { articles: Article[]; onOpen: (id: string) => void } = $props()
|
|
27
|
+
* </script>
|
|
28
|
+
*
|
|
29
|
+
* <RelatedItemsCard
|
|
30
|
+
* title="Related Articles"
|
|
31
|
+
* items={articles}
|
|
32
|
+
* viewAllHref="/articles"
|
|
33
|
+
* onItemClick={(article) => onOpen(article.id)}
|
|
34
|
+
* >
|
|
35
|
+
* {#snippet renderItem(article)}
|
|
36
|
+
* <span>{article.title}</span>
|
|
37
|
+
* {/snippet}
|
|
38
|
+
* {#snippet emptyState()}
|
|
39
|
+
* <p>No related articles yet.</p>
|
|
40
|
+
* {/snippet}
|
|
41
|
+
* </RelatedItemsCard>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* - Requires a bonded ClassMap — call `setClassMap()` (e.g. with
|
|
46
|
+
* `@molecule/app-ui-tailwind`) at startup or rendering throws.
|
|
47
|
+
* - The "View all" label is hardcoded English in the React reference (not
|
|
48
|
+
* routed through i18n) and is the same literal here; pass a translated link
|
|
49
|
+
* via `headerActions` in localized apps.
|
|
50
|
+
* - `onItemClick` rows are mouse-only `<li>` elements (no keyboard handler);
|
|
51
|
+
* render a real `<button>`/`<a>` inside `renderItem` when keyboard access
|
|
52
|
+
* matters.
|
|
53
|
+
* - `viewAllHref` renders a plain `<a href>` (full page load in SPA routers);
|
|
54
|
+
* use `headerActions` with your router's Link for client-side navigation.
|
|
55
|
+
* - Node-valued props (`title`, `icon`, `emptyState`, `headerActions`) arrive
|
|
56
|
+
* as snippets; strings render as text.
|
|
57
|
+
*
|
|
58
|
+
* @module
|
|
59
|
+
*/
|
|
60
|
+
export * from './components.js';
|
|
61
|
+
export * from './types.js';
|
|
62
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Svelte card container for cross-linked / related item lists.
|
|
3
|
+
*
|
|
4
|
+
* Exports `RelatedItemsCard` — the Svelte counterpart of
|
|
5
|
+
* `@molecule/app-related-items-card-react`: a titled Card with header + list +
|
|
6
|
+
* empty state + "View all" link, with the same props (React names) and the
|
|
7
|
+
* same DOM for the same input. Use for "Company → Deals", "Contact → Notes",
|
|
8
|
+
* "Ticket → Related Articles" panels.
|
|
9
|
+
*
|
|
10
|
+
* Props: `title` (snippet or string), `items: T[]`, `renderItem(item, index)`
|
|
11
|
+
* (a snippet with the item and its index), `icon?`, `onItemClick?(item, index)`
|
|
12
|
+
* (rows become clickable), `emptyState?` (rendered when `items` is empty),
|
|
13
|
+
* `viewAllHref?` (header "View all" link), `headerActions?` (right-aligned
|
|
14
|
+
* header slot), `className?`, `dataMolId?`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```svelte
|
|
18
|
+
* <script lang="ts">
|
|
19
|
+
* import { RelatedItemsCard } from '@molecule/app-related-items-card-svelte'
|
|
20
|
+
*
|
|
21
|
+
* interface Article {
|
|
22
|
+
* id: string
|
|
23
|
+
* title: string
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* let { articles, onOpen }: { articles: Article[]; onOpen: (id: string) => void } = $props()
|
|
27
|
+
* </script>
|
|
28
|
+
*
|
|
29
|
+
* <RelatedItemsCard
|
|
30
|
+
* title="Related Articles"
|
|
31
|
+
* items={articles}
|
|
32
|
+
* viewAllHref="/articles"
|
|
33
|
+
* onItemClick={(article) => onOpen(article.id)}
|
|
34
|
+
* >
|
|
35
|
+
* {#snippet renderItem(article)}
|
|
36
|
+
* <span>{article.title}</span>
|
|
37
|
+
* {/snippet}
|
|
38
|
+
* {#snippet emptyState()}
|
|
39
|
+
* <p>No related articles yet.</p>
|
|
40
|
+
* {/snippet}
|
|
41
|
+
* </RelatedItemsCard>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* - Requires a bonded ClassMap — call `setClassMap()` (e.g. with
|
|
46
|
+
* `@molecule/app-ui-tailwind`) at startup or rendering throws.
|
|
47
|
+
* - The "View all" label is hardcoded English in the React reference (not
|
|
48
|
+
* routed through i18n) and is the same literal here; pass a translated link
|
|
49
|
+
* via `headerActions` in localized apps.
|
|
50
|
+
* - `onItemClick` rows are mouse-only `<li>` elements (no keyboard handler);
|
|
51
|
+
* render a real `<button>`/`<a>` inside `renderItem` when keyboard access
|
|
52
|
+
* matters.
|
|
53
|
+
* - `viewAllHref` renders a plain `<a href>` (full page load in SPA routers);
|
|
54
|
+
* use `headerActions` with your router's Link for client-side navigation.
|
|
55
|
+
* - Node-valued props (`title`, `icon`, `emptyState`, `headerActions`) arrive
|
|
56
|
+
* as snippets; strings render as text.
|
|
57
|
+
*
|
|
58
|
+
* @module
|
|
59
|
+
*/
|
|
60
|
+
export * from './components.js';
|
|
61
|
+
export * from './types.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node-valued prop shape for the Svelte related-items card.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
|
+
/**
|
|
8
|
+
* A React-node-valued prop: a snippet (slot and node lists), or a plain
|
|
9
|
+
* string passed verbatim.
|
|
10
|
+
*/
|
|
11
|
+
export type ReactNodeProp = Snippet | string;
|
|
12
|
+
//# sourceMappingURL=node-prop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-prop.d.ts","sourceRoot":"","sources":["../src/node-prop.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAErC;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,CAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the Svelte card container for cross-linked / related item lists.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
|
+
import type { ReactNodeProp } from './node-prop.js';
|
|
8
|
+
/** Props accepted by the {@link RelatedItemsCard} component. */
|
|
9
|
+
export interface RelatedItemsCardProps<T> {
|
|
10
|
+
/** Card heading. A string renders as text; a node arrives as the same-named snippet. */
|
|
11
|
+
title: ReactNodeProp;
|
|
12
|
+
/** Optional leading icon in the header; arrives as the same-named snippet. */
|
|
13
|
+
icon?: ReactNodeProp;
|
|
14
|
+
/** Items to render. */
|
|
15
|
+
items: readonly T[];
|
|
16
|
+
/** Render function for each item; arrives as a snippet with the item and its index. */
|
|
17
|
+
renderItem: Snippet<[T, number]>;
|
|
18
|
+
/** Called when an item row is clicked (if applicable). */
|
|
19
|
+
onItemClick?: (item: T, index: number) => void;
|
|
20
|
+
/** Rendered when `items` is empty; arrives as the same-named snippet. */
|
|
21
|
+
emptyState?: ReactNodeProp;
|
|
22
|
+
/** Optional "View all" link rendered in the header. */
|
|
23
|
+
viewAllHref?: string;
|
|
24
|
+
/** Optional right-aligned header actions; arrives as the same-named snippet. */
|
|
25
|
+
headerActions?: ReactNodeProp;
|
|
26
|
+
/** Extra classes on the Card. */
|
|
27
|
+
className?: string;
|
|
28
|
+
/** `data-mol-id` for AI-agent selectors. */
|
|
29
|
+
dataMolId?: string;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAErC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD,gEAAgE;AAChE,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,wFAAwF;IACxF,KAAK,EAAE,aAAa,CAAA;IACpB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,uBAAuB;IACvB,KAAK,EAAE,SAAS,CAAC,EAAE,CAAA;IACnB,uFAAuF;IACvF,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA;IAChC,0DAA0D;IAC1D,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9C,yEAAyE;IACzE,UAAU,CAAC,EAAE,aAAa,CAAA;IAC1B,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gFAAgF;IAChF,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
package/dist/types.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,73 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-related-items-card-svelte",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Card container for cross-linked items: company→deals, contact→notes, ticket→articles",
|
|
5
|
+
"homepage": "https://www.molecule.dev/packages/app-related-items-card-svelte",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"svelte": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"svelte": "./dist/index.js",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"!dist/**/__tests__",
|
|
21
|
+
"!dist/**/*.test.*",
|
|
22
|
+
"!dist/**/*.spec.*",
|
|
23
|
+
"README.md"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings && svelte-package --input src --output dist --tsconfig ./tsconfig.json",
|
|
27
|
+
"dev": "svelte-package --input src --output dist --tsconfig ./tsconfig.json --watch",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"test:watch": "vitest"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"molecule",
|
|
33
|
+
"related-items-card",
|
|
34
|
+
"svelte"
|
|
35
|
+
],
|
|
36
|
+
"author": "Molecule Dev, Inc. (https://molecule.dev)",
|
|
37
|
+
"license": "Apache-2.0",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "https://github.com/molecule-dev/molecule.git",
|
|
41
|
+
"directory": "packages/app/features/related-items-card-svelte"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=20"
|
|
45
|
+
},
|
|
46
|
+
"bugs": "https://github.com/molecule-dev/molecule/issues",
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@molecule/app-svelte": "^3.5.0",
|
|
52
|
+
"@molecule/app-ui": "^1.0.1",
|
|
53
|
+
"@molecule/app-ui-svelte": "^1.1.0",
|
|
54
|
+
"svelte": "^5.0.0"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@molecule/app-framework-conformance": "0.0.0",
|
|
58
|
+
"@molecule/app-i18n": "1.2.2",
|
|
59
|
+
"@molecule/app-icons": "1.0.4",
|
|
60
|
+
"@molecule/app-svelte": "3.7.1",
|
|
61
|
+
"@molecule/app-ui": "1.4.0",
|
|
62
|
+
"@molecule/app-ui-svelte": "1.1.5",
|
|
63
|
+
"@sveltejs/package": "3.0.2",
|
|
64
|
+
"@sveltejs/vite-plugin-svelte": "7.1.2",
|
|
65
|
+
"@types/node": "26.6.5",
|
|
66
|
+
"jsdom": "30.1.3",
|
|
67
|
+
"svelte": "5.57.2",
|
|
68
|
+
"svelte-check": "4.7.7",
|
|
69
|
+
"typescript": "6.0.3",
|
|
70
|
+
"vite": "8.3.5",
|
|
71
|
+
"vitest": "4.1.12"
|
|
72
|
+
}
|
|
73
|
+
}
|