slop-editor 0.0.0-stage → 0.2.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/package.json CHANGED
@@ -1,6 +1,57 @@
1
1
  {
2
2
  "name": "slop-editor",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "A slop editor: track who wrote every word on a page (the AI, you, or nobody), then read the slop and make it yours.",
5
+ "homepage": "https://baphaelman.github.io/slop-editor/",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/baphaelman/slop-editor.git"
9
+ },
10
+ "bugs": "https://github.com/baphaelman/slop-editor/issues",
11
+ "type": "module",
12
+ "bin": {
13
+ "slop-editor": "cli.mjs"
14
+ },
15
+ "exports": {
16
+ "./slop.js": "./slop.js",
17
+ "./slop.css": "./slop.css",
18
+ "./react": "./react.mjs",
19
+ "./package.json": "./package.json"
20
+ },
21
+ "files": [
22
+ "cli.mjs",
23
+ "markup.mjs",
24
+ "react.mjs",
25
+ "slop.js",
26
+ "slop.css",
27
+ "README.md",
28
+ "LICENSE"
29
+ ],
30
+ "scripts": {
31
+ "test": "node --test test.mjs",
32
+ "test:browser": "node browser-test.mjs"
33
+ },
34
+ "engines": {
35
+ "node": ">=18"
36
+ },
37
+ "keywords": [
38
+ "ai",
39
+ "slop",
40
+ "writing",
41
+ "authorship",
42
+ "editor"
43
+ ],
44
+ "author": "Raphael Bajet",
45
+ "license": "MIT",
46
+ "peerDependencies": {
47
+ "react": ">=18"
48
+ },
49
+ "peerDependenciesMeta": {
50
+ "react": {
51
+ "optional": true
52
+ }
53
+ },
54
+ "devDependencies": {
55
+ "playwright-core": "^1.65.1"
56
+ }
57
+ }
package/react.mjs ADDED
@@ -0,0 +1,47 @@
1
+ // The slop editor in a React app: `import { SlopText, SlopMeter, slopAttrs, useSlop } from 'slop-editor/react'`.
2
+ // slop.js has to be in the page first, as a plain <script>: this hands its global Slop to the modules. No JSX and no
3
+ // build, so it works from node_modules as it is. MIT license.
4
+ import { createElement, useSyncExternalStore } from 'react';
5
+
6
+ /* global Slop */
7
+ // slop.js declares Slop with const: a global name, but not a property of window
8
+ const slop = typeof Slop === 'undefined' ? null : Slop;
9
+ if (!slop) throw new Error('slop-editor/react: put slop.js in the page before this module');
10
+ export default slop;
11
+
12
+ // after an edit in the editor, every component that called useSlop() renders again
13
+ let version = 0;
14
+ const subscribers = new Set();
15
+ slop.onChange(() => {
16
+ version++;
17
+ subscribers.forEach((fn) => fn());
18
+ });
19
+ const subscribe = (fn) => {
20
+ subscribers.add(fn);
21
+ return () => subscribers.delete(fn);
22
+ };
23
+ const snapshot = () => version;
24
+ export const useSlop = () => useSyncExternalStore(subscribe, snapshot, snapshot);
25
+
26
+ // a text as HTML, in a span (or `as`). React draws it; data-slop-ref lets the editor find it on the page. `vars` fill
27
+ // in {name}s for this one text
28
+ export function SlopText({ path, as = 'span', vars, ...props }) {
29
+ useSlop();
30
+ return createElement(as, { ...props, 'data-slop-ref': path, dangerouslySetInnerHTML: { __html: slop.html(path, vars) } });
31
+ }
32
+
33
+ // attributes from texts, as plain text: <img {...slopAttrs({ alt: 'hero.photo' })} />. The editor lists them under
34
+ // Hidden. Call it from a component that calls useSlop(), so they follow edits
35
+ export function slopAttrs(attrs, vars) {
36
+ const pairs = Object.entries(attrs);
37
+ const out = Object.fromEntries(pairs.map(([name, path]) => [name, slop.words(path, vars)]));
38
+ out['data-slop-attr'] = pairs.map(([name, path]) => `${name}:${path}`).join(' ');
39
+ if (vars) out['data-slop-vars'] = JSON.stringify(vars);
40
+ return out;
41
+ }
42
+
43
+ // a Slop-o-meter: the page's, or with a path, a group's, whose switch colors only its section (the closest
44
+ // [data-slop-section], or its parent). slop.js builds what's inside
45
+ export function SlopMeter({ path, className, ...props }) {
46
+ return createElement('div', { ...props, className: className ? `slop-meter ${className}` : 'slop-meter', 'data-slop-meter': path ?? '' });
47
+ }
package/slop.css ADDED
@@ -0,0 +1,213 @@
1
+ /* Slop editor: who wrote what (see slop.js). MIT license.
2
+ Each category's color comes from the page's text block (picked in the editor), or --slop-<id> in the page's CSS
3
+ (--slop-ai, --slop-ok, --slop-data, --slop-me), or a default for the page's background: slop.js puts .slop-dark on
4
+ <html> when it's dark, and writes the colors into a stylesheet of its own. --slop-font and --slop-mono set the
5
+ editor's fonts. */
6
+ html {
7
+ --_accent: #6d35d0;
8
+ --_font: var(--slop-font, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);
9
+ --_mono: var(--slop-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
10
+ /* the editor's own surface */
11
+ --_bg: #fdfcfa; --_sunk: #f4f2ee; --_ink: #1e1b24; --_ink-2: #57525f; --_ink-3: #8b8694; --_rule: #e5e1e8;
12
+ --_shadow: 0 1px 2px rgb(30 20 40 / 0.06), 0 18px 48px rgb(30 20 40 / 0.16);
13
+ }
14
+ html.slop-dark {
15
+ --_accent: #b892ff;
16
+ --_bg: #1b1920; --_sunk: #131217; --_ink: #f1eef5; --_ink-2: #bdb7c6; --_ink-3: #8a8494; --_rule: #2f2c36;
17
+ --_shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 18px 48px rgb(0 0 0 / 0.5);
18
+ }
19
+ .slop-data { font-variant-numeric: tabular-nums; }
20
+
21
+ /* ---------- Slop-o-meter ---------- */
22
+ .slop-meter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 16px; font: 0.78rem/1.4 var(--_font); }
23
+ .slop-meter-btn {
24
+ display: inline-flex; align-items: center; gap: 8px; padding: 4px 11px 4px 5px; border-radius: 99px;
25
+ border: 1px solid color-mix(in srgb, currentColor 22%, transparent); background: transparent; color: inherit;
26
+ font: 600 0.78rem var(--_font); letter-spacing: 0.01em; cursor: pointer;
27
+ }
28
+ .slop-meter-btn:hover { border-color: var(--slop-c-ai, var(--_accent)); }
29
+ .slop-meter-btn:focus-visible { outline: 2px solid var(--_accent); outline-offset: 2px; }
30
+ .slop-switch { position: relative; width: 26px; height: 15px; border-radius: 99px; background: color-mix(in srgb, currentColor 22%, transparent); transition: background .2s; }
31
+ .slop-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.3); transition: transform .2s; }
32
+ .slop-meter-btn[aria-pressed="true"] { border-color: var(--slop-c-ai, var(--_accent)); }
33
+ .slop-meter-btn[aria-pressed="true"] .slop-switch { background: var(--slop-c-ai, var(--_accent)); }
34
+ .slop-meter-btn[aria-pressed="true"] .slop-switch::after { transform: translateX(11px); }
35
+ .slop-meter-key { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
36
+ /* what readers see: nothing (the default), the pie with its legend, or that and the switch that colors the words */
37
+ .slop-meter:not([data-show]), .slop-meter[data-show="nothing"] { display: none; }
38
+ .slop-meter[data-show="pie"] .slop-meter-btn { display: none; }
39
+ .slop-pct { margin-left: 5px; font-weight: 700; font-variant-numeric: tabular-nums; }
40
+ .slop-pie { flex: none; width: 18px; height: 18px; border-radius: 50%; background: color-mix(in srgb, currentColor 20%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 15%, transparent); }
41
+ .slop-legend { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; font-weight: 600; }
42
+ .slop-key { display: inline-flex; align-items: center; gap: 5px; border-radius: 4px; cursor: default; }
43
+ .slop-key:focus-visible { outline: 2px solid var(--_accent); outline-offset: 2px; }
44
+ .slop-key i { width: 8px; height: 8px; border-radius: 50%; }
45
+
46
+ /* ---------- the editor ---------- */
47
+ .slop-edit-btn, .slop-panel { font-family: var(--_font); color: var(--_ink); -webkit-font-smoothing: antialiased; }
48
+ .slop-edit-btn, .slop-panel *, .slop-panel { box-sizing: border-box; }
49
+ .slop-edit-btn {
50
+ position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 2147483000;
51
+ display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 12px; border-radius: 99px;
52
+ border: 1px solid var(--_accent); background: var(--_bg); color: var(--_accent); font: 600 0.88rem var(--_font); cursor: pointer; box-shadow: var(--_shadow);
53
+ }
54
+ .slop-edit-btn::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--slop-c-ai, var(--_accent)); }
55
+ .slop-edit-btn:hover { background: color-mix(in srgb, var(--_accent) 10%, var(--_bg)); }
56
+ .slop-edit-btn[hidden], .slop-panel[hidden], .slop-panel [hidden] { display: none !important; }
57
+
58
+ .slop-panel {
59
+ position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: 2147483000; width: min(420px, calc(100vw - 24px));
60
+ display: flex; flex-direction: column; background: var(--_bg); border: 1px solid var(--_rule); border-radius: 16px;
61
+ box-shadow: var(--_shadow); font-size: 14px; line-height: 1.4; text-align: left;
62
+ }
63
+ .slop-panel button { font-family: inherit; color: inherit; }
64
+ .slop-panel :focus-visible { outline: 2px solid var(--_accent); outline-offset: 1px; }
65
+ .slop-panel p { margin: 0; }
66
+
67
+ .sp-head { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 16px 14px 10px 16px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
68
+ .slop-dragging, .slop-dragging * { user-select: none !important; -webkit-user-select: none !important; }
69
+ .slop-dragging .sp-head { cursor: grabbing; }
70
+ .sp-grip { position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--_rule); }
71
+ .sp-head:hover .sp-grip { background: var(--_ink-3); }
72
+ .sp-head h2 { margin: 0; font: 700 1.02rem/1.3 var(--_font); color: var(--_ink); }
73
+ .sp-status { margin-top: 2px; font-size: 0.78rem; color: var(--_ink-3); min-height: 1.4em; }
74
+ .sp-status[data-kind="dirty"] { color: var(--_ink-2); }
75
+ .sp-status[data-kind="error"] { color: #d0453a; }
76
+ .sp-link { padding: 0; border: 0; background: none; color: var(--_accent) !important; font: 600 0.78rem var(--_font); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
77
+ .sp-save { flex: none; margin-left: auto; height: 30px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--_accent); background: var(--_accent); color: var(--_bg) !important; font: 600 0.82rem var(--_font); font-variant-numeric: tabular-nums; cursor: pointer; }
78
+ .sp-save:hover:not(:disabled) { filter: brightness(1.1); }
79
+ .sp-save:disabled { border-color: var(--_rule); background: none; color: var(--_ink-3) !important; cursor: default; }
80
+ .sp-revert { flex: none; padding: 0 2px; border: 0; background: none; font: 600 0.72rem var(--_font); color: var(--_ink-3) !important; text-decoration: underline; text-decoration-color: var(--_rule); text-underline-offset: 2px; cursor: pointer; }
81
+ .sp-revert:hover { color: var(--_ink) !important; text-decoration-color: currentColor; }
82
+ .sp-close { flex: none; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--_rule); background: none; font-size: 1.2rem; line-height: 1; cursor: pointer; }
83
+ .sp-close:hover { background: var(--_sunk); }
84
+ /* resize handles along every edge and corner */
85
+ .sp-edge { position: absolute; z-index: 2; touch-action: none; }
86
+ .sp-edge[data-edge="n"], .sp-edge[data-edge="s"] { left: 14px; right: 14px; height: 8px; cursor: ns-resize; }
87
+ .sp-edge[data-edge="e"], .sp-edge[data-edge="w"] { top: 14px; bottom: 14px; width: 8px; cursor: ew-resize; }
88
+ .sp-edge[data-edge="n"] { top: -4px; } .sp-edge[data-edge="s"] { bottom: -4px; }
89
+ .sp-edge[data-edge="e"] { right: -4px; } .sp-edge[data-edge="w"] { left: -4px; }
90
+ .sp-edge[data-edge="ne"], .sp-edge[data-edge="nw"], .sp-edge[data-edge="se"], .sp-edge[data-edge="sw"] { width: 16px; height: 16px; }
91
+ .sp-edge[data-edge="ne"] { top: -4px; right: -4px; cursor: nesw-resize; } .sp-edge[data-edge="sw"] { bottom: -4px; left: -4px; cursor: nesw-resize; }
92
+ .sp-edge[data-edge="nw"] { top: -4px; left: -4px; cursor: nwse-resize; } .sp-edge[data-edge="se"] { bottom: -4px; right: -4px; cursor: nwse-resize; }
93
+
94
+ /* the whole page: how much is slop, the page's switch, and the categories */
95
+ .sp-cover { display: grid; gap: 10px; padding: 0 16px 14px; }
96
+ .sp-cover-row { display: flex; align-items: center; gap: 10px; }
97
+ .sp-big { font-size: 0.9rem; color: var(--_ink-2); }
98
+ .sp-big b { font: 700 1.55rem/1 var(--_font); color: var(--slop-c-ai, var(--_accent)); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
99
+ .sp-words { margin-right: auto !important; font-size: 0.78rem; color: var(--_ink-3); font-variant-numeric: tabular-nums; }
100
+ .sp-cover-row .sp-pie { width: 22px; height: 22px; }
101
+ .sp-cats { display: flex; flex-wrap: wrap; gap: 6px; }
102
+ .sp-cat { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px 0 4px; border: 1px solid var(--_rule); border-radius: 99px; font-size: 0.78rem; }
103
+ .sp-swatch { position: relative; flex: none; width: 18px; height: 18px; border-radius: 50%; overflow: hidden; cursor: pointer; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--_ink) 18%, transparent); }
104
+ .sp-swatch:hover { box-shadow: 0 0 0 2px var(--_rule), inset 0 0 0 1px color-mix(in srgb, var(--_ink) 18%, transparent); }
105
+ .sp-swatch input { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); padding: 0; border: 0; opacity: 0; cursor: pointer; }
106
+ .sp-cat-name { min-width: 3ch; padding: 0; border: 0; border-radius: 4px; background: none; font: 600 0.78rem var(--_font); color: var(--_ink); }
107
+ .sp-cat-name:hover { background: var(--_sunk); }
108
+ .sp-cat-name:focus { outline: none; background: var(--_sunk); }
109
+ .sp-cat-pct { font-weight: 500; color: var(--_ink-3); font-variant-numeric: tabular-nums; }
110
+ .sp-cat-x { margin: 0 -3px 0 -2px; padding: 0 3px; border: 0; background: none; color: var(--_ink-3) !important; font-size: 1rem; line-height: 1; cursor: pointer; }
111
+ .sp-cat-x:hover { color: var(--_ink) !important; }
112
+ .sp-show { display: flex; align-items: center; gap: 10px; font-size: 0.78rem; color: var(--_ink-3); }
113
+ .sp-seg { display: flex; flex: 1; gap: 2px; padding: 2px; border-radius: 8px; background: var(--_sunk); }
114
+ .sp-seg button { flex: 1; padding: 4px 6px; border: 0; border-radius: 6px; background: none; font-size: 0.76rem; font-weight: 600; color: var(--_ink-2); cursor: pointer; white-space: nowrap; }
115
+ .sp-seg button[aria-checked="true"] { background: var(--_bg); color: var(--_ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }
116
+ .sp-seg button:hover:not([aria-checked="true"]) { color: var(--_ink); }
117
+ .sp-cat-add, .sp-cat-new { height: 28px; padding: 0 11px; border: 1px dashed var(--_rule); border-radius: 99px; background: none; font: 600 0.78rem var(--_font); color: var(--_ink-2); cursor: pointer; }
118
+ .sp-cat-add:hover { border-color: var(--_ink-3); color: var(--_ink); }
119
+ .sp-cat-new { width: 150px; border-style: solid; border-color: var(--_accent); color: var(--_ink); cursor: text; outline: none; }
120
+
121
+ /* tabs */
122
+ .sp-tabs { display: flex; gap: 2px; margin: 0 12px; padding: 3px; border-radius: 10px; background: var(--_sunk); }
123
+ .sp-tabs button { flex: 1; padding: 6px 8px; border: 0; border-radius: 7px; background: none; color: var(--_ink-2); font-size: 0.82rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
124
+ .sp-tabs button[hidden] { display: none; }
125
+ .sp-tabs button span { margin-left: 3px; font-weight: 500; color: var(--_ink-3); font-variant-numeric: tabular-nums; }
126
+ .sp-tabs button[aria-selected="true"] { background: var(--_bg); color: var(--_ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }
127
+ .sp-tabs button:hover:not([aria-selected="true"]) { color: var(--_ink); }
128
+
129
+ .sp-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 12px 20px; }
130
+ .sp-intro { padding: 6px 4px 10px; font-size: 0.8rem; color: var(--_ink-3); }
131
+ .sp-empty { padding: 28px 12px; text-align: center; color: var(--_ink-3); font-size: 0.86rem; }
132
+
133
+ /* sections */
134
+ .sp-group { border-bottom: 1px solid var(--_rule); }
135
+ .sp-group summary { display: flex; align-items: center; gap: 8px; padding: 10px 4px; cursor: pointer; list-style: none; }
136
+ .sp-group summary::-webkit-details-marker { display: none; }
137
+ .sp-group summary::before { content: ""; flex: none; width: 6px; height: 6px; margin: 0 3px 0 1px; border: solid var(--_ink-3); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform .15s; }
138
+ .sp-group[open] summary::before { transform: rotate(45deg) translate(-2px, 0); }
139
+ .sp-gname { font-weight: 700; font-size: 0.9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
140
+ .sp-gnote { margin-left: auto; font-size: 0.74rem; color: var(--_ink-3); white-space: nowrap; }
141
+ .sp-group > .sp-field:last-child { margin-bottom: 14px; }
142
+
143
+ /* one text */
144
+ .sp-field { display: grid; gap: 5px; margin: 0 2px 12px 18px; padding: 2px; border-radius: 10px; transition: background .4s; }
145
+ .sp-body > .sp-field { margin-left: 2px; }
146
+ .sp-flash { background: color-mix(in srgb, var(--_accent) 14%, transparent); }
147
+ .sp-flabel { display: flex; align-items: center; gap: 6px; min-height: 24px; }
148
+ .sp-flabel label { min-width: 0; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.76rem; font-weight: 600; color: var(--_ink-3); }
149
+ .sp-field textarea {
150
+ display: block; width: 100%; margin: 0; padding: 7px 9px; resize: none; overflow: hidden;
151
+ font: 0.86rem/1.5 var(--_mono); color: var(--_ink); background: var(--_sunk); border: 1px solid transparent; border-radius: 8px;
152
+ }
153
+ .sp-field textarea:hover { border-color: var(--_rule); }
154
+ .sp-field textarea:focus { outline: none; border-color: var(--_accent); background: var(--_bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--_accent) 18%, transparent); }
155
+ .sp-kind { flex: none; padding: 1px 6px; border-radius: 4px; background: color-mix(in srgb, var(--_accent) 12%, transparent); font: 600 0.68rem var(--_font); color: var(--_accent); }
156
+ .sp-kind[hidden] { display: none; }
157
+ .sp-unseen { flex: none; padding: 1px 6px; border: 0; border-radius: 4px; background: var(--_sunk); font: 600 0.68rem var(--_font); color: var(--_ink-3) !important; cursor: help; }
158
+ .sp-unseen:not(:disabled) { color: var(--_accent) !important; cursor: pointer; }
159
+ .sp-unseen:not(:disabled):hover { background: color-mix(in srgb, var(--_accent) 12%, transparent); }
160
+ .sp-hint { padding: 2px 2px 0; font-size: 0.76rem; color: var(--_ink-2); }
161
+
162
+ /* a pie of what the text is made of, and its slop switch */
163
+ .sp-ctl { flex: none; display: inline-flex; align-items: center; gap: 7px; }
164
+ .sp-pie { flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--_rule); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--_ink) 14%, transparent); }
165
+ .sp-toggle {
166
+ display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 4px; border: 1px solid var(--_rule); border-radius: 99px;
167
+ background: var(--_bg); font-size: 0.74rem; font-weight: 600; color: var(--_ink-3); cursor: pointer;
168
+ }
169
+ .sp-switch { position: relative; flex: none; width: 24px; height: 14px; border-radius: 99px; background: var(--slop-c-ok, #17805a); transition: background .2s; }
170
+ .sp-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.3); transition: transform .2s; }
171
+ .sp-toggle[aria-checked="true"] { color: var(--slop-c-ai, var(--_accent)); border-color: color-mix(in srgb, var(--slop-c-ai, var(--_accent)) 45%, var(--_rule)); }
172
+ .sp-toggle[aria-checked="true"] .sp-switch { background: var(--slop-c-ai, var(--_accent)); }
173
+ .sp-toggle[aria-checked="true"] .sp-switch::after { transform: translateX(10px); }
174
+ .sp-toggle:hover:not(:disabled) { border-color: var(--_ink-3); }
175
+ .sp-still .sp-switch, .sp-still .sp-switch::after { transition: none; }
176
+ .sp-toggle:disabled { opacity: 0.45; cursor: default; }
177
+ .sp-toggle:disabled .sp-switch { background: var(--_rule); }
178
+
179
+ /* marking text: shown under the focused text */
180
+ .sp-assign { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding-top: 2px; }
181
+ .sp-assign-label { margin-right: 2px; font-size: 0.72rem; color: var(--_ink-3); }
182
+ .sp-as { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 6px; border: 1px solid var(--_rule); border-radius: 99px; background: var(--_bg); font-size: 0.72rem; font-weight: 600; color: var(--_ink-2) !important; cursor: pointer; }
183
+ .sp-as i { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--_ink) 15%, transparent); }
184
+ .sp-as:hover { border-color: var(--_ink-3); color: var(--_ink) !important; }
185
+
186
+ /* the repeat badge: the same words are elsewhere too */
187
+ .sp-rep {
188
+ flex: none; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px 0 6px; border-radius: 6px;
189
+ border: 1px dashed color-mix(in srgb, var(--_accent) 55%, var(--_rule)); background: none; color: var(--_accent) !important;
190
+ font-size: 0.72rem; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer;
191
+ }
192
+ .sp-rep::before { content: ""; width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 2px; box-shadow: 2.5px -2.5px 0 -1px var(--_bg), 2.5px -2.5px 0 0.5px currentColor; margin-right: 2px; }
193
+ .sp-rep:hover { background: color-mix(in srgb, var(--_accent) 10%, transparent); }
194
+
195
+ /* Repeats: one card per repeated text */
196
+ .sp-set { margin: 0 0 12px; padding: 10px; border: 1px solid var(--_rule); border-radius: 12px; }
197
+ .sp-set .sp-flabel label { color: var(--_accent); }
198
+ .sp-where { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
199
+ .sp-goto { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 8px 3px 5px; border: 1px solid var(--_rule); border-radius: 6px; background: none; font-size: 0.74rem; color: var(--_ink-2) !important; cursor: pointer; }
200
+ .sp-goto:hover { border-color: var(--_ink-3); color: var(--_ink) !important; }
201
+ .sp-pie.sp-mini { width: 10px; height: 10px; }
202
+
203
+ /* on the page, while the editor is open */
204
+ .slop-editing [data-slop] { cursor: text; }
205
+ .slop-editing [data-slop]:hover { outline: 1px dashed color-mix(in srgb, var(--_accent) 60%, transparent); outline-offset: 3px; border-radius: 2px; }
206
+ .slop-focus { outline: 2px solid var(--_accent) !important; outline-offset: 3px; border-radius: 2px; }
207
+ .slop-copy { outline: 2px dashed var(--_accent) !important; outline-offset: 3px; border-radius: 2px; }
208
+
209
+ @media (max-width: 900px) {
210
+ .slop-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 60svh; }
211
+ .sp-head { cursor: ns-resize; }
212
+ .sp-edge:not([data-edge="n"]) { display: none; }
213
+ }