sveltekit-ui 1.1.85 → 1.1.87

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.87 - 2026-10-03
4
+
5
+ ### Toolchain
6
+
7
+ - Require Node.js 24 or newer for the package and documentation development.
8
+ - Update Vite and Vitest, and respect peer dependencies and Node engine constraints during dependency upgrades.
9
+ - Preserve the public SvelteKit 2 and 3 component APIs; TypeScript 7 remains excluded by the current Svelte toolchain peers.
10
+
11
+ ## 1.1.86 - 2026-10-02
12
+
13
+ ### SvelteKit compatibility
14
+
15
+ - Support SvelteKit 2.22.2 and newer alongside SvelteKit 3 while preserving the public component and manager APIs.
16
+ - Use `esm-env` for browser flags and rewrite source `#lib` imports to relative paths when packaging.
17
+ - Preserve native internal-link navigation, including static resources, modified clicks, and navigation cancellation.
18
+ - Migrate the documentation app to SvelteKit 3, Vercel adapter 7, explicit public environment variables, and Vite plugin configuration.
19
+ - Preserve documentation analytics using the generic Analytics API, with manual SvelteKit navigation tracking that does not depend on removed stores.
20
+
3
21
  ## Unreleased
4
22
 
5
23
  ### Component fixes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SvelteKit UI
2
2
 
3
- SvelteKit UI is a Svelte 5 component library built around paired components and reactive manager functions. It is intended for SvelteKit 2 applications.
3
+ SvelteKit UI is a Svelte 5 component library built around paired components and reactive manager functions. It supports SvelteKit 2 and 3 applications.
4
4
 
5
5
  The component documentation and interactive examples live at [sveltekit-ui.com](https://www.sveltekit-ui.com).
6
6
 
@@ -45,7 +45,7 @@ npm run dev
45
45
 
46
46
  Copy `.env.example` to `.env` and provide `PUBLIC_APPLE_MAPKIT_JS_API_KEY` if you want to run the MapKit showcases locally.
47
47
 
48
- Keep TypeScript on version 6 for the current Svelte tooling, even when writing JavaScript. The `.ncurc.js` configuration lets `ncu -u` update TypeScript within version 6 while other packages continue receiving normal updates.
48
+ The package and documentation app require Node.js 24 or newer. The documentation app uses SvelteKit 3 and TypeScript 6, even when writing JavaScript. The `.ncurc.js` configuration updates development and runtime dependencies while respecting peer dependencies and the current Node engine. TypeScript 7 is held until SvelteKit and `svelte-check` support it. Analytics remains pinned until a compatible stable release supports SvelteKit 3.
49
49
 
50
50
  Before publishing, run the complete verification suite:
51
51
 
@@ -55,6 +55,8 @@ npm run verify
55
55
 
56
56
  This checks the Svelte source, runs tests, generates and verifies the distributable package, and builds the documentation site.
57
57
 
58
+ To verify a packed release in clean SvelteKit 2 and 3 consumers, run `node scripts/verify-kit-consumers.js /absolute/path/to/sveltekit-ui.tgz`. The consumers install their dependencies with normal peer validation, then compile the public components for server and browser use and check server-rendered pages.
59
+
58
60
  Publish with `npm run publish:npm`. It checks npm for the newest published release, selects the next patch version when needed, keeps `package.json` and `package-lock.json` in sync, and runs verification before publishing. A prepared version that is newer than the published releases is reused, so retrying a failed publish does not skip another version.
59
61
 
60
62
  Preview the version without changing files or publishing:
@@ -66,7 +68,8 @@ npm run version:available -- --dry-run
66
68
  ## Compatibility and releases
67
69
 
68
70
  - Svelte 5 is required.
69
- - SvelteKit 2 is required because some components use SvelteKit navigation and environment modules.
71
+ - SvelteKit 2.22.2 or newer, or SvelteKit 3, is required because some components use SvelteKit navigation modules.
72
+ - Browser flags use `esm-env`. Source `#lib` imports are rewritten to relative imports in the published package; consumers do not need to configure the library's source alias.
70
73
  - Public API changes are documented with package releases. Consumers should review release notes before adopting a new minor version.
71
74
 
72
75
  The experimental Contibase code generator is available at [contibase.com/code_generator](https://www.contibase.com/code_generator).
@@ -1,6 +1,6 @@
1
1
  import { create_unique_id } from "../../client/index.js"
2
2
  import { create_button_manager } from "../Button/index.svelte.js"
3
- import { browser } from "$app/environment"
3
+ import { BROWSER as browser } from "esm-env"
4
4
 
5
5
  export function create_alert_manager(config) {
6
6
  let alerts = $state([])
@@ -1,4 +1,4 @@
1
- import { browser } from "$app/environment"
1
+ import { BROWSER as browser } from "esm-env"
2
2
  import { create_button_manager } from "../Button/index.svelte.js"
3
3
  import { create_popover_manager } from "../Popover/index.svelte.js"
4
4
  import { create_slider_manager } from "../Slider/index.svelte.js"
@@ -1,5 +1,4 @@
1
1
  <script>
2
- import { goto } from "$app/navigation"
3
2
  import LoadingWheel from "../LoadingWheel/index.svelte"
4
3
  import Audio from "../Audio/index.svelte"
5
4
  import Code from "../Code/index.svelte"
@@ -9,7 +9,7 @@
9
9
  import AIPanel from "./Panels/AI/index.svelte"
10
10
  import FilePanel from "./Panels/File/index.svelte"
11
11
  import { onDestroy } from "svelte"
12
- import { browser } from "$app/environment"
12
+ import { BROWSER as browser } from "esm-env"
13
13
 
14
14
  let { manager } = $props()
15
15
 
@@ -8,8 +8,6 @@ import {
8
8
  set_closurable,
9
9
  set_closurable_color,
10
10
  } from "../../client/index.js"
11
- import { goto } from "$app/navigation"
12
- // import { page } from "$app/state"
13
11
 
14
12
  export { normalize_link_href }
15
13
 
@@ -30,18 +28,18 @@ export function create_link_manager(config) {
30
28
  let display_text = $derived(set_closurable(config?.display_text, null))
31
29
  let text_color = $derived(set_closurable_color(config?.text_color, null))
32
30
  let is_internal_link = $derived(is_internal_href(href))
33
- // let is_internal_link = $derived(new URL(href, page?.url?.origin)?.origin === page?.url?.origin)
34
31
  let is_show_preview = $derived(set_closurable(config?.is_show_preview, !is_internal_link))
35
32
 
36
33
  function handle_a_click(e) {
37
34
  if (e?.defaultPrevented || e?.metaKey || e?.ctrlKey || e?.shiftKey || e?.altKey || (e?.button != null && e.button !== 0)) {
38
35
  return
39
36
  }
37
+ // Let SvelteKit's native anchor handler distinguish app routes, hashes and
38
+ // static resources, and preserve beforeNavigate cancellation.
39
+ if (is_internal_link) return
40
40
  e?.preventDefault?.()
41
41
  if (!href) return
42
- if (is_internal_link) {
43
- goto(href)
44
- } else if (is_show_preview) {
42
+ if (is_show_preview) {
45
43
  popover_manager.open()
46
44
  } else {
47
45
  open_link()
@@ -51,7 +49,18 @@ export function create_link_manager(config) {
51
49
  function open_link(is_open_same_tab = false) {
52
50
  if (!href) return
53
51
  if (is_internal_link) {
54
- goto(href)
52
+ if (typeof document === "undefined" || !document.body) return
53
+ // Imperative callers use the same cancellable native navigation as the
54
+ // rendered anchor, including static resources that are not Kit routes.
55
+ const anchor = document.createElement("a")
56
+ anchor.href = href
57
+ anchor.hidden = true
58
+ document.body.append(anchor)
59
+ try {
60
+ anchor.click()
61
+ } finally {
62
+ anchor.remove()
63
+ }
55
64
  } else {
56
65
  if (typeof config?.on_goto_external_link == "function") {
57
66
  config?.on_goto_external_link(href)
@@ -84,13 +93,17 @@ export function create_link_manager(config) {
84
93
  support_icon: "link",
85
94
  text: "Open Link In New Tab",
86
95
  text_align: "left",
87
- on_click: () => open_link(),
96
+ href: () => (is_internal_link ? href : null),
97
+ target: "_blank",
98
+ rel: "noopener noreferrer",
99
+ on_click: () => { if (!is_internal_link) open_link() },
88
100
  })
89
101
  goto_link_same_tab_button_manager = create_button_manager({
90
102
  support_icon: "link_internal",
91
103
  text: "Open Link In Same Tab",
92
104
  text_align: "left",
93
- on_click: () => open_link(true),
105
+ href: () => (is_internal_link ? href : null),
106
+ on_click: () => { if (!is_internal_link) open_link(true) },
94
107
  })
95
108
  inline_goto_link_button_manager = create_button_manager({
96
109
  type: "soft",
@@ -101,7 +114,8 @@ export function create_link_manager(config) {
101
114
  is_uniform: true,
102
115
  aria_label: "Open link",
103
116
  support_icon: () => (is_internal_link ? "link_internal" : "link"),
104
- on_click: () => open_link(),
117
+ href: () => (is_internal_link ? href : null),
118
+ on_click: () => { if (!is_internal_link) open_link() },
105
119
  })
106
120
  qr_manager = create_qr_manager({
107
121
  data: href,
@@ -1,7 +1,7 @@
1
1
  import { create_unique_id, set_closurable } from "../../client/index.js"
2
2
  import { create_popover_manager } from "../Popover/index.svelte.js"
3
3
  import { create_button_manager } from "../Button/index.svelte.js"
4
- import { browser } from "$app/environment"
4
+ import { BROWSER as browser } from "esm-env"
5
5
  import { load_mapkit_script } from "../../client/mapkit.js"
6
6
 
7
7
  function as_finite_number(value) {
@@ -4,7 +4,7 @@ import { create_popover_manager } from "../Popover/index.svelte.js"
4
4
  import { create_text_input_manager } from "../TextInput/index.svelte.js"
5
5
  import { create_dropdown_manager } from "../Dropdown/index.svelte.js"
6
6
  import { create_checkbox_manager } from "../Checkbox/index.svelte.js"
7
- import { browser } from "$app/environment"
7
+ import { BROWSER as browser } from "esm-env"
8
8
  import { get_mapkit_api, load_mapkit_script } from "../../client/mapkit.js"
9
9
 
10
10
  export function create_location_input_manager(config) {
@@ -19,7 +19,7 @@ import {
19
19
  variables_data_type_remaining_to_astc,
20
20
  } from "../../client/index.js"
21
21
  import { tick } from "svelte"
22
- import { browser } from "$app/environment"
22
+ import { BROWSER as browser } from "esm-env"
23
23
  import { literal_types } from "../../client/types/index.js"
24
24
 
25
25
  export function create_table_advanced_manager(config) {
@@ -1,7 +1,7 @@
1
1
  import { create_unique_id, set_closurable } from "../../client/index.js"
2
2
  import { create_popover_manager } from "../Popover/index.svelte.js"
3
3
  import { create_button_manager } from "../Button/index.svelte.js"
4
- import { browser } from "$app/environment"
4
+ import { BROWSER as browser } from "esm-env"
5
5
 
6
6
  export function create_text_input_manager(config) {
7
7
  const defaults = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sveltekit-ui",
3
- "version": "1.1.85",
3
+ "version": "1.1.87",
4
4
  "description": "A SvelteKit UI component library for building modern web applications",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -32,9 +32,9 @@
32
32
  "dev": "vite dev",
33
33
  "build": "vite build",
34
34
  "preview": "vite preview",
35
- "check": "svelte-check --tsconfig ./jsconfig.json --fail-on-warnings",
35
+ "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --fail-on-warnings",
36
36
  "test": "vitest run",
37
- "package": "npm run clean:dist && svelte-package -t false",
37
+ "package": "npm run clean:dist && svelte-package --no-types",
38
38
  "pack:check": "node ./scripts/verify-package.js",
39
39
  "verify": "npm run check && npm run test && npm run package && npm run pack:check && npm run build",
40
40
  "clean:dist": "node ./scripts/clean-dist.js",
@@ -45,24 +45,25 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "context-filter-polyfill": "^0.3.23",
48
+ "esm-env": "^1.2.2",
48
49
  "qr-code-styling": "^1.9.2"
49
50
  },
50
51
  "peerDependencies": {
51
- "@sveltejs/kit": "^2.22.2",
52
+ "@sveltejs/kit": "^2.22.2 || ^3.0.0",
52
53
  "svelte": "^5.0.0"
53
54
  },
54
55
  "devDependencies": {
55
- "@sveltejs/adapter-vercel": "^6.3.4",
56
- "@sveltejs/kit": "^2.70.3",
57
- "@sveltejs/package": "^2.5.8",
56
+ "@sveltejs/adapter-vercel": "^7.0.0",
57
+ "@sveltejs/kit": "^3.0.0",
58
+ "@sveltejs/package": "^3.0.0",
58
59
  "@sveltejs/vite-plugin-svelte": "^7.3.1",
59
- "@vercel/analytics": "^2.0.1",
60
+ "@vercel/analytics": "1.3.2",
60
61
  "jsdom": "^30.1.1",
61
62
  "svelte": "^5.57.1",
62
63
  "svelte-check": "^4.7.6",
63
64
  "typescript": "^6.0.3",
64
- "vite": "^8.3.1",
65
- "vitest": "^5.0.2"
65
+ "vite": "^8.3.2",
66
+ "vitest": "^5.0.3"
66
67
  },
67
68
  "homepage": "https://www.sveltekit-ui.com",
68
69
  "keywords": [
@@ -73,14 +74,17 @@
73
74
  "library"
74
75
  ],
75
76
  "engines": {
76
- "node": ">=22.12.0"
77
+ "node": ">=24.0.0"
77
78
  },
78
79
  "publishConfig": {
79
80
  "access": "public"
80
81
  },
81
82
  "overrides": {
82
83
  "brace-expansion": "^5.0.12",
83
- "cookie": "^0.7.2",
84
84
  "tar": "^7.5.22"
85
+ },
86
+ "imports": {
87
+ "#lib": "./src/lib/index.js",
88
+ "#lib/*": "./src/lib/*"
85
89
  }
86
90
  }