@docs.plus/extension-hyperlink 2.0.0 → 2.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/CHANGELOG.md +49 -0
- package/README.md +60 -661
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +61 -83
- package/dist/index.d.ts +61 -83
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/styles.css +8 -49
- package/package.json +16 -14
package/dist/styles.css
CHANGED
|
@@ -1,31 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* A minimal, framework-agnostic stylesheet for the prebuilt create/preview/edit
|
|
5
|
-
* popovers. Every visual token is exposed as a `--hl-*` CSS custom property so
|
|
6
|
-
* consumers can retheme without copy-pasting rules.
|
|
7
|
-
*
|
|
8
|
-
* Usage:
|
|
9
|
-
* import '@docs.plus/extension-hyperlink/styles.css'
|
|
10
|
-
*
|
|
11
|
-
* Theming:
|
|
12
|
-
* :root {
|
|
13
|
-
* --hl-accent: #2563eb;
|
|
14
|
-
* --hl-radius: 8px;
|
|
15
|
-
* }
|
|
16
|
-
*
|
|
17
|
-
* Customizing a specific rule is fine — class names are part of the public API
|
|
18
|
-
* and are documented in the README.
|
|
2
|
+
* Prebuilt popover skin. Tokens are `--hl-*`; class names are public (see README).
|
|
3
|
+
* Theme with `light-dark()` against the nearest ancestor `color-scheme`.
|
|
19
4
|
*/
|
|
20
5
|
|
|
21
6
|
/*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* popover automatically, and it no longer gets stuck in dark mode just
|
|
26
|
-
* because the OS prefers dark. When `color-scheme` is `normal` (the
|
|
27
|
-
* default), `light-dark()` falls back to `prefers-color-scheme`, which
|
|
28
|
-
* preserves the previous OS-driven behavior for unopinionated hosts.
|
|
7
|
+
* `light-dark()` follows the nearest ancestor `color-scheme`. When that is
|
|
8
|
+
* `normal`, it falls back to `prefers-color-scheme` so unopinionated hosts
|
|
9
|
+
* keep OS-driven dark mode.
|
|
29
10
|
*/
|
|
30
11
|
:root {
|
|
31
12
|
--hl-bg: light-dark(#ffffff, #1f2937);
|
|
@@ -50,13 +31,7 @@
|
|
|
50
31
|
--hl-transition: 120ms ease-out;
|
|
51
32
|
}
|
|
52
33
|
|
|
53
|
-
/*
|
|
54
|
-
Floating popover shell (shared by all three popovers — preview / edit / create)
|
|
55
|
-
Positioning (fixed + top/left + z-index 9999) is inline from createPopover;
|
|
56
|
-
override stacking via `createPopover({ zIndex })`.
|
|
57
|
-
extension-hypermultimedia's media-toolbar.css carries a lockstep copy of
|
|
58
|
-
this shell — mirror edits there.
|
|
59
|
-
------------------------------------------------------------------------- */
|
|
34
|
+
/* Shared shell. Positioning is inline from createPopover (`zIndex` option). Lockstep copy in hypermultimedia media-toolbar.css. */
|
|
60
35
|
.floating-popover {
|
|
61
36
|
opacity: 0;
|
|
62
37
|
transform: scale(0.96);
|
|
@@ -121,14 +96,7 @@
|
|
|
121
96
|
z-index: 2;
|
|
122
97
|
}
|
|
123
98
|
|
|
124
|
-
/*
|
|
125
|
-
Floating tooltip (icon buttons in the prebuilt popovers)
|
|
126
|
-
Behavior ships in the bundled @docs.plus/floating-tooltip; this skin is
|
|
127
|
-
the consumer's, lockstep with extension-hypermultimedia's media-toolbar.css.
|
|
128
|
-
Both extensions style this one global class, so the block uses identical
|
|
129
|
-
literals, never per-package tokens: with both bundles loaded, cascade
|
|
130
|
-
order would pick one package's tokens for every bubble.
|
|
131
|
-
------------------------------------------------------------------------- */
|
|
99
|
+
/* Tooltip skin. Lockstep literals with hypermultimedia media-toolbar.css — both style one global class. */
|
|
132
100
|
.floating-tooltip {
|
|
133
101
|
position: fixed;
|
|
134
102
|
z-index: 10000;
|
|
@@ -152,9 +120,6 @@
|
|
|
152
120
|
transform: translateY(0);
|
|
153
121
|
}
|
|
154
122
|
|
|
155
|
-
/* -------------------------------------------------------------------------
|
|
156
|
-
Popover shell — shared shape for create / preview / edit
|
|
157
|
-
------------------------------------------------------------------------- */
|
|
158
123
|
.hyperlink-create-popover,
|
|
159
124
|
.hyperlink-preview-popover,
|
|
160
125
|
.hyperlink-edit-popover {
|
|
@@ -181,7 +146,6 @@
|
|
|
181
146
|
width: 100%;
|
|
182
147
|
}
|
|
183
148
|
|
|
184
|
-
/* Input groups (create + edit) */
|
|
185
149
|
.hyperlink-create-popover .inputs-wrapper,
|
|
186
150
|
.hyperlink-edit-popover .text-wrapper,
|
|
187
151
|
.hyperlink-edit-popover .href-wrapper {
|
|
@@ -277,7 +241,6 @@
|
|
|
277
241
|
min-width: 0;
|
|
278
242
|
}
|
|
279
243
|
|
|
280
|
-
/* Action buttons (create submit + edit back/apply) */
|
|
281
244
|
.hyperlink-create-popover .buttons-wrapper,
|
|
282
245
|
.hyperlink-edit-popover .buttons-wrapper {
|
|
283
246
|
display: flex;
|
|
@@ -322,9 +285,6 @@
|
|
|
322
285
|
outline-offset: 1px;
|
|
323
286
|
}
|
|
324
287
|
|
|
325
|
-
/* -------------------------------------------------------------------------
|
|
326
|
-
Preview popover (anchor + copy / edit / remove icon buttons)
|
|
327
|
-
------------------------------------------------------------------------- */
|
|
328
288
|
.hyperlink-preview-popover a {
|
|
329
289
|
display: inline-block;
|
|
330
290
|
max-width: 260px;
|
|
@@ -394,9 +354,8 @@
|
|
|
394
354
|
justify-content: center;
|
|
395
355
|
}
|
|
396
356
|
|
|
397
|
-
/*
|
|
357
|
+
/* Tooltip guard sits after the tooltip rules so it wins the cascade. The popover guard is at the top. */
|
|
398
358
|
@media (prefers-reduced-motion: reduce) {
|
|
399
|
-
.floating-popover,
|
|
400
359
|
.floating-tooltip {
|
|
401
360
|
transition: none;
|
|
402
361
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docs.plus/extension-hyperlink",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Tiptap extension for hyperlinks with built-in popovers, auto-linking, and 50+ URL scheme support",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"cypress:run": "bunx cypress run",
|
|
49
49
|
"cypress:open": "bunx cypress open",
|
|
50
50
|
"docs:screenshots": "bun run build && bunx start-server-and-test playground http://127.0.0.1:5173 'bunx cypress run --config specPattern=cypress/docs/**/*.cy.ts'",
|
|
51
|
+
"docs:gif": "bun run build && bunx start-server-and-test playground http://127.0.0.1:5173 'bun cypress/docs/demo-gif.ts'",
|
|
51
52
|
"prepack": "bunx release-prepack",
|
|
52
53
|
"prepublishOnly": "bunx release-preflight"
|
|
53
54
|
},
|
|
@@ -61,10 +62,11 @@
|
|
|
61
62
|
},
|
|
62
63
|
"keywords": [
|
|
63
64
|
"tiptap",
|
|
64
|
-
"tiptap
|
|
65
|
+
"tiptap-extension",
|
|
65
66
|
"hyperlink",
|
|
66
67
|
"link",
|
|
67
68
|
"autolink",
|
|
69
|
+
"link-preview",
|
|
68
70
|
"rich-text-editor",
|
|
69
71
|
"floating-ui",
|
|
70
72
|
"url-validation",
|
|
@@ -72,28 +74,28 @@
|
|
|
72
74
|
"docs.plus"
|
|
73
75
|
],
|
|
74
76
|
"dependencies": {
|
|
75
|
-
"@floating-ui/dom": "^1.
|
|
77
|
+
"@floating-ui/dom": "^1.8.0",
|
|
76
78
|
"linkifyjs": "^4.3.3"
|
|
77
79
|
},
|
|
78
80
|
"peerDependencies": {
|
|
79
|
-
"@tiptap/core": "^3.
|
|
80
|
-
"@tiptap/pm": "^3.
|
|
81
|
+
"@tiptap/core": "^3.31.3",
|
|
82
|
+
"@tiptap/pm": "^3.31.3"
|
|
81
83
|
},
|
|
82
84
|
"devDependencies": {
|
|
83
85
|
"@docs.plus/floating-popover": "0.0.0",
|
|
84
86
|
"@docs.plus/floating-tooltip": "0.0.0",
|
|
85
87
|
"@docs.plus/playground": "0.0.0",
|
|
86
88
|
"@docs.plus/release-tooling": "0.1.0",
|
|
87
|
-
"@tiptap/core": "^3.
|
|
88
|
-
"@tiptap/markdown": "^3.
|
|
89
|
-
"@tiptap/pm": "^3.
|
|
90
|
-
"@tiptap/starter-kit": "^3.
|
|
91
|
-
"@types/node": "^25.5
|
|
92
|
-
"bun-types": "^1.
|
|
93
|
-
"cypress": "^15.
|
|
89
|
+
"@tiptap/core": "^3.31.3",
|
|
90
|
+
"@tiptap/markdown": "^3.31.3",
|
|
91
|
+
"@tiptap/pm": "^3.31.3",
|
|
92
|
+
"@tiptap/starter-kit": "^3.31.3",
|
|
93
|
+
"@types/node": "^25.9.5",
|
|
94
|
+
"bun-types": "^1.4.2",
|
|
95
|
+
"cypress": "^15.21.1",
|
|
94
96
|
"cypress-real-events": "^1.15.0",
|
|
95
|
-
"eslint": "^9.39.
|
|
96
|
-
"start-server-and-test": "^2.1.
|
|
97
|
+
"eslint": "^9.39.5",
|
|
98
|
+
"start-server-and-test": "^2.1.5",
|
|
97
99
|
"tsup": "^8.5.1",
|
|
98
100
|
"typescript": "^5.9.3"
|
|
99
101
|
}
|