intelliwaketssveltekitv25 1.0.69 → 1.0.72
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/TabHref.svelte +57 -50
- package/dist/TabHref.svelte.d.ts +2 -1
- package/package.json +4 -2
package/dist/TabHref.svelte
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import Icon from './Icon.svelte'
|
|
10
10
|
import { cubicInOut } from 'svelte/easing'
|
|
11
11
|
import { fly } from 'svelte/transition'
|
|
12
|
+
import path from 'node:path'
|
|
12
13
|
|
|
13
14
|
let {
|
|
14
15
|
tabHrefs,
|
|
@@ -22,7 +23,8 @@
|
|
|
22
23
|
consoleLogs = false,
|
|
23
24
|
noResolveHidden = false,
|
|
24
25
|
printAllTabs = false,
|
|
25
|
-
rounded = false
|
|
26
|
+
rounded = false,
|
|
27
|
+
slug = $bindable(null)
|
|
26
28
|
}: {
|
|
27
29
|
tabHrefs: ITabHref[]
|
|
28
30
|
basePath?: string | undefined
|
|
@@ -36,6 +38,7 @@
|
|
|
36
38
|
noResolveHidden?: boolean
|
|
37
39
|
printAllTabs?: boolean
|
|
38
40
|
rounded?: boolean
|
|
41
|
+
slug?: string | null
|
|
39
42
|
} = $props()
|
|
40
43
|
|
|
41
44
|
let tabPrefix = $derived(noTabAdjustments ? '' : 'Tab')
|
|
@@ -118,70 +121,73 @@
|
|
|
118
121
|
}
|
|
119
122
|
|
|
120
123
|
async function mountAction() {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
124
|
+
slug = pathAnalyzer?.activePageSlug ?? null
|
|
125
|
+
if (!reclickToClose) {
|
|
126
|
+
if (browser && pathAnalyzer && storage && pathAnalyzer?.basePath.endsWith(
|
|
127
|
+
`/${basePath}`) && (pathAnalyzer.activePageComponents?.length ?? 0) < 3) {
|
|
128
|
+
await tick()
|
|
129
|
+
|
|
130
|
+
if (consoleLogs) console.info('mountAction', pathAnalyzer.activePageSlugs)
|
|
131
|
+
|
|
132
|
+
if (!noResolveHidden && pathAnalyzer?.activePageSlug && !visibleItems?.some(
|
|
133
|
+
item => getSlug(item)?.includes(pathAnalyzer?.activePageFull ?? '(NoNe)') ?? true)) {
|
|
134
|
+
const toItem = visibleItems.find(item => item.isInitial) ?? visibleItems.find(() => true)
|
|
135
|
+
if (toItem) {
|
|
136
|
+
goto(toItem.href, { replaceState: true })
|
|
137
|
+
return
|
|
138
|
+
}
|
|
133
139
|
}
|
|
134
|
-
}
|
|
135
140
|
|
|
136
|
-
|
|
137
|
-
|
|
141
|
+
let previousID: string | number | null | undefined = null
|
|
142
|
+
let newTab: string | null | undefined = null
|
|
138
143
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
144
|
+
if (!pathAnalyzer?.activePageSlug) {
|
|
145
|
+
if (consoleLogs) {
|
|
146
|
+
console.info(
|
|
147
|
+
getTabSetting(),
|
|
148
|
+
getSlug(tabHrefs.find(tabHref => !tabHref.hidden && tabHref.isInitial)),
|
|
149
|
+
getSlug(tabHrefs.find(tabHref => !tabHref.hidden))
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
newTab = CoalesceFalsey(
|
|
142
154
|
getTabSetting(),
|
|
143
155
|
getSlug(tabHrefs.find(tabHref => !tabHref.hidden && tabHref.isInitial)),
|
|
144
156
|
getSlug(tabHrefs.find(tabHref => !tabHref.hidden))
|
|
145
157
|
)
|
|
146
158
|
}
|
|
147
159
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
getSlug(tabHrefs.find(tabHref => !tabHref.hidden))
|
|
152
|
-
)
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
if (!basePathDigits) {
|
|
156
|
-
previousID = getIDSetting()
|
|
157
|
-
}
|
|
160
|
+
if (!basePathDigits) {
|
|
161
|
+
previousID = getIDSetting()
|
|
162
|
+
}
|
|
158
163
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
164
|
+
if (previousID) {
|
|
165
|
+
// const newPathAnalyzer = new PathAnalyzer(page, basePath)
|
|
166
|
+
// newPathAnalyzer.base = `${noDigitsBasePath}${previousID}`
|
|
162
167
|
|
|
163
|
-
|
|
168
|
+
await tick()
|
|
164
169
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
170
|
+
if (consoleLogs) {
|
|
171
|
+
console.info(
|
|
172
|
+
'ID', previousID, 'newTab', newTab, 'slug', pathAnalyzer?.activePageSlug, 'URL',
|
|
173
|
+
pathAnalyzer?.open(newTab ?? '', false),
|
|
174
|
+
pathAnalyzer.basePathReplaced(`${noDigitsBasePath}${previousID}`,
|
|
175
|
+
newTab ?? pathAnalyzer?.activePageSlug ?? ''
|
|
176
|
+
)
|
|
171
177
|
)
|
|
172
|
-
|
|
173
|
-
}
|
|
178
|
+
}
|
|
174
179
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
180
|
+
// await goto(pathAnalyzer.basePathReplaced(`${noDigitsBasePath}${previousID}`, newTab ?? pathAnalyzer?.activePageSlug ?? ''), {replaceState: true})
|
|
181
|
+
} else {
|
|
182
|
+
setIDSetting()
|
|
178
183
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
184
|
+
if (newTab) {
|
|
185
|
+
await tick()
|
|
186
|
+
if (consoleLogs) {
|
|
187
|
+
console.info('No ID newTab', newTab, pathAnalyzer?.open(newTab, false))
|
|
188
|
+
}
|
|
189
|
+
await goto(pathAnalyzer?.open(newTab, false), { replaceState: true })
|
|
183
190
|
}
|
|
184
|
-
await goto(pathAnalyzer?.open(newTab, false), { replaceState: true })
|
|
185
191
|
}
|
|
186
192
|
}
|
|
187
193
|
}
|
|
@@ -193,7 +199,7 @@
|
|
|
193
199
|
|
|
194
200
|
afterNavigate(() => {
|
|
195
201
|
if (consoleLogs) console.info('aN', pathAnalyzer?.activePageSlug)
|
|
196
|
-
if (browser && storage && pathAnalyzer && pathAnalyzer?.activePageSlug && pathAnalyzer?.activePageSlug != getTabSetting() && pathAnalyzer?.basePath.endsWith(
|
|
202
|
+
if (browser && storage && !reclickToClose && pathAnalyzer && pathAnalyzer?.activePageSlug && pathAnalyzer?.activePageSlug != getTabSetting() && pathAnalyzer?.basePath.endsWith(
|
|
197
203
|
`/${basePath}`)) {
|
|
198
204
|
setTabSetting(pathAnalyzer?.activePageSlug)
|
|
199
205
|
}
|
|
@@ -239,6 +245,7 @@
|
|
|
239
245
|
>
|
|
240
246
|
<div
|
|
241
247
|
class="tab_href_indicator absolute h-8 z-10 bg-transparent border-b-2 border-b-primary-selected transition-all duration-300 ease-[cubic-bezier(0.4,0,0.2,1)] select-none pointer-events-none"
|
|
248
|
+
hidden={!pathAnalyzer?.activePageSlug}
|
|
242
249
|
style={indicatorStyles}
|
|
243
250
|
in:fly={{ y: 10, duration: 200, easing: cubicInOut }}>
|
|
244
251
|
|
package/dist/TabHref.svelte.d.ts
CHANGED
|
@@ -12,7 +12,8 @@ type $$ComponentProps = {
|
|
|
12
12
|
noResolveHidden?: boolean;
|
|
13
13
|
printAllTabs?: boolean;
|
|
14
14
|
rounded?: boolean;
|
|
15
|
+
slug?: string | null;
|
|
15
16
|
};
|
|
16
|
-
declare const TabHref: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
17
|
+
declare const TabHref: import("svelte").Component<$$ComponentProps, {}, "slug">;
|
|
17
18
|
type TabHref = ReturnType<typeof TabHref>;
|
|
18
19
|
export default TabHref;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intelliwaketssveltekitv25",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.72",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"exports": {
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"svelte": "./dist/index.js",
|
|
10
10
|
"import": "./dist/index.js",
|
|
11
11
|
"default": "./dist/index.js"
|
|
12
|
-
}
|
|
12
|
+
},
|
|
13
|
+
"./*.svelte": "./dist/*.svelte"
|
|
13
14
|
},
|
|
14
15
|
"main": "./dist/index.js",
|
|
15
16
|
"module": "./dist/index.js",
|
|
@@ -89,6 +90,7 @@
|
|
|
89
90
|
"lint": "prettier --check . && eslint .",
|
|
90
91
|
"format": "prettier --write .",
|
|
91
92
|
"Install-IntelliWake": "pnpm install && pnpm update -P @solidbasisventures/intelliwaketsfoundation",
|
|
93
|
+
"NPM-Login": "npm login",
|
|
92
94
|
"Publish": "pnpm version patch && git push --tags && git push && pnpm publish",
|
|
93
95
|
"Version-Minor-Advance": "pnpm version minor"
|
|
94
96
|
}
|