autosolutions-os 0.4.0 → 0.4.2
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 +80 -0
- package/README.md +14 -9
- package/dist/feedback.d.ts +3 -2
- package/dist/feedback.js +42 -16
- package/dist/feedbackAsk.d.ts +4 -0
- package/dist/feedbackAsk.js +47 -0
- package/dist/feedbackSend.d.ts +18 -0
- package/dist/feedbackSend.js +28 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/nav.d.ts +12 -10
- package/dist/nav.js +16 -11
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,85 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.2 - 2026-11-05
|
|
4
|
+
|
|
5
|
+
The ? becomes a Feedback button that people see, and pasting a picture into
|
|
6
|
+
the feedback form works in every browser, Safari too (Didac asked for both on
|
|
7
|
+
5 November 2026, and picked the button's look: "B", with more space before
|
|
8
|
+
the company).
|
|
9
|
+
|
|
10
|
+
### The Feedback button
|
|
11
|
+
|
|
12
|
+
- The ? left of the company plate is now a pill in the logo's pink and
|
|
13
|
+
purple, with a chat icon and the word Feedback. Its name for screen readers
|
|
14
|
+
stays "Send feedback".
|
|
15
|
+
- 20px before the company plate (was 4px); 12px on a phone.
|
|
16
|
+
- For its first minute on a page its colour drifts slowly from pink to purple
|
|
17
|
+
and back. It stops for good once the person has opened the form in this
|
|
18
|
+
browser (localStorage `autosolutions-os:feedback-seen`; a browser that
|
|
19
|
+
keeps nothing still gets a working button). It never moves with reduced
|
|
20
|
+
motion.
|
|
21
|
+
- Phones (measured on the Hub's bar): the icon and the word from 410px, the
|
|
22
|
+
word alone from 380px (a 390px iPhone), the icon alone below. The search
|
|
23
|
+
gives way first; the plate stays whole.
|
|
24
|
+
- The button brings its own styles (a `<style>` inside it, `OS_FEEDBACK_ASK_CSS`),
|
|
25
|
+
drawn right on a server-rendered first page. Apps change nothing.
|
|
26
|
+
- An app that adds its own buttons to the bar leaves less room on a phone:
|
|
27
|
+
none does today.
|
|
28
|
+
|
|
29
|
+
### autosolutions-os/feedback
|
|
30
|
+
|
|
31
|
+
- A paste reads the picture from `clipboardData.files` and, when `files` has
|
|
32
|
+
no picture, from `clipboardData.items` (items of kind "file"). Safari, and
|
|
33
|
+
some "Copy image" menus, give the picture only in `items`. A browser that
|
|
34
|
+
fills both gives the same picture in each, so it is added once.
|
|
35
|
+
- A paste with no picture (text) goes on as normal: the form stops a paste
|
|
36
|
+
only when it adds a picture.
|
|
37
|
+
- Safari sends no paste event while a button or a radio has focus. Cmd+V or
|
|
38
|
+
Ctrl+V there now moves focus to the text box first, so the paste lands in
|
|
39
|
+
the form.
|
|
40
|
+
- A HEIC, GIF or TIFF picture is redrawn as a JPEG when the browser can read
|
|
41
|
+
it, as before; when it cannot, the form says "Use a PNG, JPEG or WebP
|
|
42
|
+
picture."
|
|
43
|
+
- New: `pastedPictures(clipboardData)` (also from `autosolutions-os`), the
|
|
44
|
+
pictures in a paste, and its type `OsPastedData`.
|
|
45
|
+
- Unchanged: the form, its limits (three pictures, 3 MB each), what it sends,
|
|
46
|
+
and the button's place (left of the company plate).
|
|
47
|
+
- Apps take this release with a lockfile bump.
|
|
48
|
+
|
|
49
|
+
## 0.4.1 - 2026-11-05
|
|
50
|
+
|
|
51
|
+
The owner's sheet has Commercial > Tools > Line form populator, which the
|
|
52
|
+
Hub drew as a sample page with mock data. Our real app for it is Key
|
|
53
|
+
Accounts, which the menu drew as a row of its own, Key accounts, at the end of
|
|
54
|
+
Commercial > Tools, one of our three Live apps the map does not have. The
|
|
55
|
+
owner said yes (4 November 2026) to making them one row: the Hub's menu keeps
|
|
56
|
+
dashboards, and functional apps live in their own repos.
|
|
57
|
+
|
|
58
|
+
### autosolutions-os/nav
|
|
59
|
+
|
|
60
|
+
- Commercial > Tools > Line form populator is the Key Accounts app's row:
|
|
61
|
+
id `key-accounts` (kept, so `OS_TOOL_LINKS["key-accounts"]` and its
|
|
62
|
+
permissions stay), label "Line form populator", glyph
|
|
63
|
+
`com-line-form-populator`, Live, in the sheet's place (fifth, after Trade
|
|
64
|
+
marketing calendar). Commercial > Tools has seven rows.
|
|
65
|
+
- The sample row `line-form-populator` and the row Key accounts at the end
|
|
66
|
+
are gone. `OS_TOOL_ALIASES["line-form-populator"]` is `key-accounts`, so an
|
|
67
|
+
app's tool, link or lock under the old id lands on the new row.
|
|
68
|
+
- 51 tools (Steve's 11 in Finance, the sheet's 38 elsewhere, Line form
|
|
69
|
+
populator among them, and our two: Shelf simulator and PM Copilot), still
|
|
70
|
+
20 Live; one sample row fewer (34).
|
|
71
|
+
- Someone who does not hold Key Accounts sees the row locked, where Line form
|
|
72
|
+
populator opened the Hub's sample page before, as for every app's row.
|
|
73
|
+
- The core follows (migration `hub_permissions_line_form_populator`): the
|
|
74
|
+
catalogue row `key-accounts` is labelled Line form populator, at the sample
|
|
75
|
+
row's place; the settings held on the sample row move to the archive and
|
|
76
|
+
the row leaves the catalogue; the app is named Line Form Populator in the
|
|
77
|
+
Hub's switcher.
|
|
78
|
+
- Unchanged: every other id, link, tab, route and lock.
|
|
79
|
+
- Apps take this release with a lockfile bump. An app whose tests name the row
|
|
80
|
+
Key accounts, count the tools or list the sample rows updates them. Key
|
|
81
|
+
Accounts' own frame shows its row as Line form populator, with its tabs.
|
|
82
|
+
|
|
3
83
|
## 0.4.0 - 2026-11-05
|
|
4
84
|
|
|
5
85
|
One way to send feedback in every app (Didac, 5 November 2026: "Yes, all A").
|
package/README.md
CHANGED
|
@@ -95,9 +95,10 @@ person signs out in the app.
|
|
|
95
95
|
`OsWorkspaceFrame` is the frame every app on the core renders around its pages:
|
|
96
96
|
the top bar with the company's mark and switcher, the rail, the OS menu (Cliff's
|
|
97
97
|
menu map, 0.3.0, with Steve Gordijn's Finance since 0.3.6 and the owner's sheet
|
|
98
|
-
since 0.3.8:
|
|
99
|
-
since 0.3.3, our Shelf simulator
|
|
100
|
-
|
|
98
|
+
since 0.3.8: 51 tools and an Overview first in every function, Marketing's
|
|
99
|
+
since 0.3.3, our Shelf simulator and PM Copilot among them, and Key Accounts
|
|
100
|
+
as the sheet's Line form populator since 0.4.1; Candidate hub, a standalone
|
|
101
|
+
app since 0.3.10, is a row of its own frame only),
|
|
101
102
|
the Hub panel, the footer with Admin for people who manage
|
|
102
103
|
something, and the browser-tab icon. It needs `autosolutions-design-system`
|
|
103
104
|
6.5.0 or later (an optional peer: only this entry point uses it). Take this
|
|
@@ -442,12 +443,16 @@ On the server there is no cookie to read, so the hook gives the fallback:
|
|
|
442
443
|
render the frame in the browser only (Asset Portal's staff face does), or
|
|
443
444
|
accept a first paint of the fallback.
|
|
444
445
|
|
|
445
|
-
### Feedback: the
|
|
446
|
+
### Feedback: the Feedback button in the top bar (0.4.0; the button 0.4.2)
|
|
446
447
|
|
|
447
|
-
Every app has one way to send feedback: the
|
|
448
|
-
of the company plate
|
|
449
|
-
|
|
450
|
-
|
|
448
|
+
Every app has one way to send feedback: the Feedback button in the top bar,
|
|
449
|
+
left of the company plate (a pink-to-purple pill with a chat icon; on a small
|
|
450
|
+
phone the word or the icon alone; its colour drifts for a page's first minute
|
|
451
|
+
until the person has opened the form once). It opens the same form
|
|
452
|
+
everywhere: a type (Bug, Idea, Question, Other), what happened, and up to
|
|
453
|
+
three pictures (picked, pasted or dropped; PNG, JPEG or WebP, 3 MB each, big
|
|
454
|
+
ones made smaller first; a paste reads the clipboard's files, or its items as
|
|
455
|
+
Safari gives them). Send adds
|
|
451
456
|
what the page knows (the app, the page's path, title and address, the company
|
|
452
457
|
on the plate, the browser, the screen, the language, the time zone, the app's
|
|
453
458
|
commit from Lovable's `data-commit-sha`, and this package's version) and posts
|
|
@@ -475,7 +480,7 @@ const core = useCoreFrame({
|
|
|
475
480
|
```
|
|
476
481
|
|
|
477
482
|
Without `feedback` the hook gives `core.feedback === null`, so an app shows
|
|
478
|
-
the
|
|
483
|
+
the button only once it hands its token. The form is a native `<dialog>` with its
|
|
479
484
|
own styles: it needs no stylesheet from the app, sits above the app's own
|
|
480
485
|
layout, and Escape closes it. Closing it keeps the draft until it is sent.
|
|
481
486
|
`autosolutions-os/feedback` also exports the form's logic (`sendFeedback`,
|
package/dist/feedback.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type OsFeedbackProps } from "./feedbackSend.js";
|
|
2
|
-
export {
|
|
3
|
-
|
|
2
|
+
export { OS_FEEDBACK_ASK_CSS } from "./feedbackAsk.js";
|
|
3
|
+
export { OS_FEEDBACK_LIMITS, OS_FEEDBACK_TYPES, feedbackContext, feedbackEndpoint, pastedPictures, readPicture, sendFeedback, type OsFeedbackPicture, type OsFeedbackProps, type OsFeedbackResult, type OsFeedbackTenant, type OsFeedbackType, type OsPastedData, } from "./feedbackSend.js";
|
|
4
|
+
/** The bar's Feedback button and its form. */
|
|
4
5
|
export declare function OsFeedbackButton({ appKey, token, tenant, endpoint }: OsFeedbackProps): import("react").JSX.Element;
|
package/dist/feedback.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
|
-
* autosolutions-os/feedback (0.4.0): the
|
|
4
|
-
* feedback form every app shares.
|
|
3
|
+
* autosolutions-os/feedback (0.4.0): the Feedback button in the top bar (a ?
|
|
4
|
+
* until 0.4.2), and the one feedback form every app shares.
|
|
5
5
|
*
|
|
6
|
-
* OsWorkspaceFrame draws the
|
|
6
|
+
* OsWorkspaceFrame draws the button by itself, left of the company plate.
|
|
7
7
|
* An app on its own project gets it from `useCoreFrame({ feedback })` as
|
|
8
8
|
* `core.feedback`, for its TopBar's `actions`.
|
|
9
9
|
*
|
|
@@ -23,10 +23,12 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
23
23
|
* is sent or the page reloads.
|
|
24
24
|
*/
|
|
25
25
|
import { useEffect, useId, useRef, useState } from "react";
|
|
26
|
-
import { OS_FEEDBACK_LIMITS, OS_FEEDBACK_TYPES, readPicture, sendFeedback, } from "./feedbackSend.js";
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
import { OS_FEEDBACK_LIMITS, OS_FEEDBACK_TYPES, pastedPictures, readPicture, sendFeedback, } from "./feedbackSend.js";
|
|
27
|
+
import { keepSeen, OS_FEEDBACK_ASK_CSS, readSeen } from "./feedbackAsk.js";
|
|
28
|
+
export { OS_FEEDBACK_ASK_CSS } from "./feedbackAsk.js";
|
|
29
|
+
export { OS_FEEDBACK_LIMITS, OS_FEEDBACK_TYPES, feedbackContext, feedbackEndpoint, pastedPictures, readPicture, sendFeedback, } from "./feedbackSend.js";
|
|
30
|
+
/* Lucide's message-circle-more (ISC), inline so the bar fetches nothing. */
|
|
31
|
+
const GLYPH = (_jsxs("svg", { className: "osfb-ask__icon", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", children: [_jsx("path", { d: "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719" }), _jsx("path", { d: "M8 12h.01" }), _jsx("path", { d: "M12 12h.01" }), _jsx("path", { d: "M16 12h.01" })] }));
|
|
30
32
|
const D = 'dialog[data-os-feedback="dialog"]';
|
|
31
33
|
const CSS = `
|
|
32
34
|
${D}{box-sizing:border-box;width:min(34rem,calc(100vw - 2rem));max-width:none;max-height:calc(100vh - 2rem);margin:auto;padding:0;border:1px solid var(--ws-color-panel-stroke,#E6E6E8);border-radius:var(--ws-radius-sheet,1rem);background:var(--ws-color-surface,#FFFFFF);color:var(--ws-color-text,#303030);font-family:var(--ws-font,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif);font-size:.875rem;line-height:1.45;text-align:start;box-shadow:0 1.25rem 3.75rem rgba(0,0,0,.25);overflow:auto}
|
|
@@ -66,12 +68,23 @@ ${D} .osfb-alert ul{margin:.375rem 0 0;padding-inline-start:1.25rem}
|
|
|
66
68
|
${D} .osfb-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
|
|
67
69
|
`;
|
|
68
70
|
const EMPTY = { type: "bug", message: "", pictures: [] };
|
|
69
|
-
/** The
|
|
71
|
+
/** The bar's Feedback button and its form. */
|
|
70
72
|
export function OsFeedbackButton({ appKey, token, tenant, endpoint }) {
|
|
71
73
|
const [open, setOpen] = useState(false);
|
|
72
74
|
/* Kept here, not in the dialog, so closing the form keeps what was typed. */
|
|
73
75
|
const [draft, setDraft] = useState(EMPTY);
|
|
74
|
-
|
|
76
|
+
const [seen, setSeen] = useState(false);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (readSeen())
|
|
79
|
+
setSeen(true);
|
|
80
|
+
}, []);
|
|
81
|
+
return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: seen ? "as-topbar__target osfb-ask is-seen" : "as-topbar__target osfb-ask", "aria-label": "Send feedback", title: "Send feedback", "aria-haspopup": "dialog", "data-os-feedback": "button", onClick: () => {
|
|
82
|
+
setOpen(true);
|
|
83
|
+
if (!seen) {
|
|
84
|
+
setSeen(true);
|
|
85
|
+
keepSeen();
|
|
86
|
+
}
|
|
87
|
+
}, children: [_jsx("style", { children: OS_FEEDBACK_ASK_CSS }), GLYPH, _jsx("span", { className: "osfb-ask__word", children: "Feedback" })] }), open && (_jsx(FeedbackDialog, { appKey: appKey, token: token, tenant: tenant ?? null, ...(endpoint ? { endpoint } : {}), draft: draft, setDraft: setDraft, onClose: () => setOpen(false) }))] }));
|
|
75
88
|
}
|
|
76
89
|
function FeedbackDialog({ appKey, token, tenant, endpoint, draft, setDraft, onClose, }) {
|
|
77
90
|
const ref = useRef(null);
|
|
@@ -114,13 +127,30 @@ function FeedbackDialog({ appKey, token, tenant, endpoint, draft, setDraft, onCl
|
|
|
114
127
|
if (good.length)
|
|
115
128
|
setDraft((d) => ({ ...d, pictures: [...d.pictures, ...good].slice(0, OS_FEEDBACK_LIMITS.pictures) }));
|
|
116
129
|
};
|
|
130
|
+
/* A paste with a picture adds the picture; any other paste (text) goes on
|
|
131
|
+
as normal. pastedPictures reads clipboardData.files, and items when files
|
|
132
|
+
has none (Safari). */
|
|
117
133
|
const onPaste = (e) => {
|
|
118
|
-
const files =
|
|
134
|
+
const files = pastedPictures(e.clipboardData);
|
|
119
135
|
if (files.length === 0)
|
|
120
136
|
return;
|
|
121
137
|
e.preventDefault();
|
|
122
138
|
void addFiles(files);
|
|
123
139
|
};
|
|
140
|
+
/* Keys typed in the form are the form's: the frame's and the app's own key
|
|
141
|
+
handlers above it (menus, search) never see them. Escape still closes the
|
|
142
|
+
dialog (its cancel event). Safari sends no paste event while a button or
|
|
143
|
+
a radio has focus, so Cmd+V or Ctrl+V there moves focus to the text box
|
|
144
|
+
first, and the paste (a picture or text) lands in the form. */
|
|
145
|
+
const onKeyDown = (e) => {
|
|
146
|
+
e.stopPropagation();
|
|
147
|
+
if (!(e.metaKey || e.ctrlKey) || e.altKey || e.key.toLowerCase() !== "v")
|
|
148
|
+
return;
|
|
149
|
+
const at = e.target;
|
|
150
|
+
const typing = at?.tagName === "TEXTAREA" || (at?.tagName === "INPUT" && at.type === "text") || at?.isContentEditable;
|
|
151
|
+
if (!typing)
|
|
152
|
+
text.current?.focus();
|
|
153
|
+
};
|
|
124
154
|
const onDrop = (e) => {
|
|
125
155
|
if (!e.dataTransfer?.files?.length)
|
|
126
156
|
return;
|
|
@@ -163,11 +193,7 @@ function FeedbackDialog({ appKey, token, tenant, endpoint, draft, setDraft, onCl
|
|
|
163
193
|
return (_jsxs("dialog", { ref: ref, "data-os-feedback": "dialog", "aria-labelledby": `${id}-title`, onCancel: (e) => {
|
|
164
194
|
e.preventDefault();
|
|
165
195
|
close();
|
|
166
|
-
},
|
|
167
|
-
/* Keys typed in the form are the form's: the frame's and the app's own
|
|
168
|
-
key handlers above it (menus, search) never see them. Escape still
|
|
169
|
-
closes the dialog (its cancel event). */
|
|
170
|
-
onKeyDown: (e) => e.stopPropagation(), onPaste: onPaste, onDragOver: (e) => {
|
|
196
|
+
}, onKeyDown: onKeyDown, onPaste: onPaste, onDragOver: (e) => {
|
|
171
197
|
if (e.dataTransfer?.types?.includes("Files"))
|
|
172
198
|
e.preventDefault();
|
|
173
199
|
}, onDrop: onDrop, children: [_jsx("style", { children: CSS }), _jsxs("form", { className: "osfb-form", method: "dialog", onSubmit: (e) => {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const OS_FEEDBACK_ASK_CSS = "\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{width:auto;height:2.25rem;gap:.375rem;margin-inline-end:1rem;padding:0 .875rem 0 .6875rem;border:0;border-radius:999px;background:linear-gradient(110deg,#D1007C 0%,#6E3192 50%,#D1007C 100%);background-size:200% 100%;background-position:0% 50%;color:#FFFFFF;font:inherit;font-size:.8125rem;font-weight:600;line-height:1;white-space:nowrap;animation:osfb-ask-drift 6s ease-in-out 1s 10 alternate}\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask:hover{filter:brightness(1.1)}\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask:active{filter:brightness(.95)}\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.is-seen{animation:none}\n.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask .osfb-ask__icon{display:block;flex:0 0 auto}\n@keyframes osfb-ask-drift{from{background-position:0% 50%}to{background-position:100% 50%}}\n@media (max-width:767px){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{margin-inline-end:.5rem;gap:.3125rem;padding:0 .6875rem 0 .5rem}}\n@media (max-width:409px){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{padding:0 .75rem}.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask .osfb-ask__icon{display:none}}\n@media (max-width:379px){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{width:2.25rem;padding:0}.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask .osfb-ask__icon{display:block}.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask .osfb-ask__word{display:none}}\n@media (max-width:359px){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{margin-inline-end:.25rem}}\n@media (prefers-reduced-motion:reduce){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{animation:none}}\n@media (forced-colors:active){.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask{border:1px solid ButtonText;background:ButtonFace;color:ButtonText;forced-color-adjust:none}}\n";
|
|
2
|
+
export declare const OS_FEEDBACK_SEEN_KEY = "autosolutions-os:feedback-seen";
|
|
3
|
+
export declare function readSeen(): boolean;
|
|
4
|
+
export declare function keepSeen(): void;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The bar's Feedback button (0.4.2; Didac, 5 November 2026, picked "B" with
|
|
3
|
+
* more space before the company). A pill in the logo's pink and purple, with
|
|
4
|
+
* a chat icon and the word Feedback, 20px before the company plate (12px on
|
|
5
|
+
* a phone). For its first minute on a page its colour drifts slowly from pink
|
|
6
|
+
* to purple and back, until the person has opened the form once in this
|
|
7
|
+
* browser (`is-seen`, kept in localStorage); never with reduced motion.
|
|
8
|
+
* Phones: the icon and the word from 410px, the word alone from 380px (a
|
|
9
|
+
* 390px iPhone), the icon alone below (measured on the Hub's bar: the search
|
|
10
|
+
* gives way, the plate stays whole, the bar keeps its end padding).
|
|
11
|
+
* Six classes outrank the frame's `.as-frame.as-ws > ... .as-topbar__target`
|
|
12
|
+
* (five), which sizes every bar target as a 36px circle.
|
|
13
|
+
*/
|
|
14
|
+
const A = ".osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask.osfb-ask";
|
|
15
|
+
export const OS_FEEDBACK_ASK_CSS = `
|
|
16
|
+
${A}{width:auto;height:2.25rem;gap:.375rem;margin-inline-end:1rem;padding:0 .875rem 0 .6875rem;border:0;border-radius:999px;background:linear-gradient(110deg,#D1007C 0%,#6E3192 50%,#D1007C 100%);background-size:200% 100%;background-position:0% 50%;color:#FFFFFF;font:inherit;font-size:.8125rem;font-weight:600;line-height:1;white-space:nowrap;animation:osfb-ask-drift 6s ease-in-out 1s 10 alternate}
|
|
17
|
+
${A}:hover{filter:brightness(1.1)}
|
|
18
|
+
${A}:active{filter:brightness(.95)}
|
|
19
|
+
${A}.is-seen{animation:none}
|
|
20
|
+
${A} .osfb-ask__icon{display:block;flex:0 0 auto}
|
|
21
|
+
@keyframes osfb-ask-drift{from{background-position:0% 50%}to{background-position:100% 50%}}
|
|
22
|
+
@media (max-width:767px){${A}{margin-inline-end:.5rem;gap:.3125rem;padding:0 .6875rem 0 .5rem}}
|
|
23
|
+
@media (max-width:409px){${A}{padding:0 .75rem}${A} .osfb-ask__icon{display:none}}
|
|
24
|
+
@media (max-width:379px){${A}{width:2.25rem;padding:0}${A} .osfb-ask__icon{display:block}${A} .osfb-ask__word{display:none}}
|
|
25
|
+
@media (max-width:359px){${A}{margin-inline-end:.25rem}}
|
|
26
|
+
@media (prefers-reduced-motion:reduce){${A}{animation:none}}
|
|
27
|
+
@media (forced-colors:active){${A}{border:1px solid ButtonText;background:ButtonFace;color:ButtonText;forced-color-adjust:none}}
|
|
28
|
+
`;
|
|
29
|
+
/* Opened once in this browser: the button stops drifting for good. Storage can
|
|
30
|
+
be missing or refuse (private windows, blocked site data); then it drifts. */
|
|
31
|
+
export const OS_FEEDBACK_SEEN_KEY = "autosolutions-os:feedback-seen";
|
|
32
|
+
export function readSeen() {
|
|
33
|
+
try {
|
|
34
|
+
return globalThis.localStorage?.getItem(OS_FEEDBACK_SEEN_KEY) === "1";
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export function keepSeen() {
|
|
41
|
+
try {
|
|
42
|
+
globalThis.localStorage?.setItem(OS_FEEDBACK_SEEN_KEY, "1");
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
/* nothing to keep it in */
|
|
46
|
+
}
|
|
47
|
+
}
|
package/dist/feedbackSend.d.ts
CHANGED
|
@@ -64,5 +64,23 @@ export declare function sendFeedback(input: {
|
|
|
64
64
|
endpoint?: string;
|
|
65
65
|
fetch?: typeof fetch;
|
|
66
66
|
}): Promise<OsFeedbackResult>;
|
|
67
|
+
/** What a paste or a drop carries: its files, and each item that is a file. */
|
|
68
|
+
export type OsPastedData = {
|
|
69
|
+
files?: ArrayLike<File> | null;
|
|
70
|
+
items?: ArrayLike<{
|
|
71
|
+
kind: string;
|
|
72
|
+
type: string;
|
|
73
|
+
getAsFile(): File | null;
|
|
74
|
+
}> | null;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* The pictures in a paste (0.4.2). Most browsers put a copied picture in
|
|
78
|
+
* `clipboardData.files`. Safari, and some "Copy image" menus, give it only in
|
|
79
|
+
* `clipboardData.items` (an item of kind "file"). This reads `files` first;
|
|
80
|
+
* only when `files` has no picture does it read `items`, because a browser
|
|
81
|
+
* that fills both puts the same picture in each. An item's file with no type
|
|
82
|
+
* takes the item's type. Text is never a picture, so a text paste gives [].
|
|
83
|
+
*/
|
|
84
|
+
export declare function pastedPictures(data: OsPastedData | null | undefined): File[];
|
|
67
85
|
/** One picture the person added, made ready to send, or a sentence saying why it cannot be. */
|
|
68
86
|
export declare function readPicture(file: File): Promise<OsFeedbackPicture | string>;
|
package/dist/feedbackSend.js
CHANGED
|
@@ -116,6 +116,34 @@ async function shrink(file) {
|
|
|
116
116
|
bitmap.close?.();
|
|
117
117
|
return await new Promise((resolve) => canvas.toBlob((blob) => resolve(blob), "image/jpeg", 0.85));
|
|
118
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* The pictures in a paste (0.4.2). Most browsers put a copied picture in
|
|
121
|
+
* `clipboardData.files`. Safari, and some "Copy image" menus, give it only in
|
|
122
|
+
* `clipboardData.items` (an item of kind "file"). This reads `files` first;
|
|
123
|
+
* only when `files` has no picture does it read `items`, because a browser
|
|
124
|
+
* that fills both puts the same picture in each. An item's file with no type
|
|
125
|
+
* takes the item's type. Text is never a picture, so a text paste gives [].
|
|
126
|
+
*/
|
|
127
|
+
export function pastedPictures(data) {
|
|
128
|
+
if (!data)
|
|
129
|
+
return [];
|
|
130
|
+
const files = Array.from(data.files ?? []).filter((f) => f.type.startsWith("image/"));
|
|
131
|
+
if (files.length)
|
|
132
|
+
return files;
|
|
133
|
+
const out = [];
|
|
134
|
+
for (const item of Array.from(data.items ?? [])) {
|
|
135
|
+
if (item.kind !== "file")
|
|
136
|
+
continue;
|
|
137
|
+
const f = item.getAsFile();
|
|
138
|
+
if (!f)
|
|
139
|
+
continue;
|
|
140
|
+
const type = f.type || item.type;
|
|
141
|
+
if (!type.startsWith("image/"))
|
|
142
|
+
continue;
|
|
143
|
+
out.push(f.type ? f : new File([f], f.name || "picture", { type }));
|
|
144
|
+
}
|
|
145
|
+
return out;
|
|
146
|
+
}
|
|
119
147
|
/** One picture the person added, made ready to send, or a sentence saying why it cannot be. */
|
|
120
148
|
export async function readPicture(file) {
|
|
121
149
|
if (!file.type.startsWith("image/"))
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ export { loadOsContext, invalidateOsContext, refreshOsContext, retryOsContext, w
|
|
|
5
5
|
export { isEntitled, isActiveMember, appRole, appVariant, currentTenant, toolAllowed, myAdminScope, canManageCurrentCompany, type AdminScope, } from "./identity.js";
|
|
6
6
|
export { OsAppSwitcher, OsAppSwitcherPlate, OsCompanySwitcher, OsBar, useCompanySwitch } from "./chrome.js";
|
|
7
7
|
export { OsAuthGate, type OsAuthGateProps } from "./gate.js";
|
|
8
|
-
export { OsFeedbackButton, sendFeedback, feedbackContext, feedbackEndpoint, readPicture, OS_FEEDBACK_TYPES, OS_FEEDBACK_LIMITS, type OsFeedbackProps, type OsFeedbackResult, type OsFeedbackTenant, type OsFeedbackType, type OsFeedbackPicture, } from "./feedback.js";
|
|
8
|
+
export { OsFeedbackButton, sendFeedback, feedbackContext, feedbackEndpoint, readPicture, pastedPictures, OS_FEEDBACK_TYPES, OS_FEEDBACK_LIMITS, type OsFeedbackProps, type OsFeedbackResult, type OsFeedbackTenant, type OsFeedbackType, type OsFeedbackPicture, type OsPastedData, } from "./feedback.js";
|
|
9
9
|
export { osAccessToken } from "./client.js";
|
|
10
10
|
export { OS_VERSION } from "./version.js";
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,6 @@ export { loadOsContext, invalidateOsContext, refreshOsContext, retryOsContext, w
|
|
|
5
5
|
export { isEntitled, isActiveMember, appRole, appVariant, currentTenant, toolAllowed, myAdminScope, canManageCurrentCompany, } from "./identity.js";
|
|
6
6
|
export { OsAppSwitcher, OsAppSwitcherPlate, OsCompanySwitcher, OsBar, useCompanySwitch } from "./chrome.js";
|
|
7
7
|
export { OsAuthGate } from "./gate.js";
|
|
8
|
-
export { OsFeedbackButton, sendFeedback, feedbackContext, feedbackEndpoint, readPicture, OS_FEEDBACK_TYPES, OS_FEEDBACK_LIMITS, } from "./feedback.js";
|
|
8
|
+
export { OsFeedbackButton, sendFeedback, feedbackContext, feedbackEndpoint, readPicture, pastedPictures, OS_FEEDBACK_TYPES, OS_FEEDBACK_LIMITS, } from "./feedback.js";
|
|
9
9
|
export { osAccessToken } from "./client.js";
|
|
10
10
|
export { OS_VERSION } from "./version.js";
|
package/dist/nav.d.ts
CHANGED
|
@@ -71,11 +71,12 @@ export declare const OS_FUNCTIONS: OsNavItem[];
|
|
|
71
71
|
* views, an Overview at the top of every function (Cliff draws one for
|
|
72
72
|
* Finance, Commercial and Operations; Marketing's is the owner's, 0.3.3), and
|
|
73
73
|
* the two rows the design keeps from before its merge (Customer scorecard,
|
|
74
|
-
* Clearance list). Then our
|
|
74
|
+
* Clearance list). Then our two Live apps the map does not have, at the end
|
|
75
75
|
* of their groups, so they stay reachable: Shelf simulator (Marketing >
|
|
76
|
-
* Tools)
|
|
77
|
-
*
|
|
78
|
-
*
|
|
76
|
+
* Tools) and PM Copilot (Operations > Tools); they borrow
|
|
77
|
+
* ops-inventory-value (a stocked shelf) and hub-tasks. Key accounts was the
|
|
78
|
+
* third until 0.4.1, when it became the sheet's Line form populator row
|
|
79
|
+
* (Commercial > Tools, in the sheet's place, under its id key-accounts). Owner, source and cadence stay in
|
|
79
80
|
* the sheet. Icons are glyph ids from the design system's NAV_ICONS, which
|
|
80
81
|
* draws them inline. Ids renamed in 0.3.0 are in OS_TOOL_ALIASES.
|
|
81
82
|
*
|
|
@@ -114,13 +115,14 @@ export declare const OS_FUNCTIONS: OsNavItem[];
|
|
|
114
115
|
*/
|
|
115
116
|
export declare const OS_MENU: Record<OsMenuFunction, OsToolGroup[]>;
|
|
116
117
|
/**
|
|
117
|
-
* Ids the menu map had before 0.3.0, and the
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
118
|
+
* Ids the menu map had before 0.3.0, and line-form-populator, the Hub's
|
|
119
|
+
* sample row until 0.4.1, and the row each is now: an app that still passes
|
|
120
|
+
* one (a tool of its own, a link, a reason it is locked) lands on the new
|
|
121
|
+
* row. Inventory value kept its id and moved to Finance in 0.3.0, as
|
|
122
|
+
* Inventory valuation, then back to Operations in 0.3.6.
|
|
121
123
|
*/
|
|
122
124
|
export declare const OS_TOOL_ALIASES: Readonly<Record<string, string>>;
|
|
123
|
-
/** The menu map's id for `id`: itself, or the row an id
|
|
125
|
+
/** The menu map's id for `id`: itself, or the row an old id (OS_TOOL_ALIASES) is now. */
|
|
124
126
|
export declare function osToolId(id: string): string;
|
|
125
127
|
/**
|
|
126
128
|
* The page in the Hub where a row with no app of its own goes (0.3.0): the
|
|
@@ -550,7 +552,7 @@ export type OsMenuEntry = {
|
|
|
550
552
|
/** Unique among the entries: the function, the row, and the tab when it is one. */
|
|
551
553
|
key: string;
|
|
552
554
|
label: string;
|
|
553
|
-
/** Where it sits, for telling the five Overviews apart: "Finance", "Hub · Smart Comms Hub", "
|
|
555
|
+
/** Where it sits, for telling the five Overviews apart: "Finance", "Hub · Smart Comms Hub", "Line form populator". */
|
|
554
556
|
context: string;
|
|
555
557
|
icon?: string;
|
|
556
558
|
state: OsFrameState;
|
package/dist/nav.js
CHANGED
|
@@ -47,11 +47,12 @@ const overview = (fn) => ({
|
|
|
47
47
|
* views, an Overview at the top of every function (Cliff draws one for
|
|
48
48
|
* Finance, Commercial and Operations; Marketing's is the owner's, 0.3.3), and
|
|
49
49
|
* the two rows the design keeps from before its merge (Customer scorecard,
|
|
50
|
-
* Clearance list). Then our
|
|
50
|
+
* Clearance list). Then our two Live apps the map does not have, at the end
|
|
51
51
|
* of their groups, so they stay reachable: Shelf simulator (Marketing >
|
|
52
|
-
* Tools)
|
|
53
|
-
*
|
|
54
|
-
*
|
|
52
|
+
* Tools) and PM Copilot (Operations > Tools); they borrow
|
|
53
|
+
* ops-inventory-value (a stocked shelf) and hub-tasks. Key accounts was the
|
|
54
|
+
* third until 0.4.1, when it became the sheet's Line form populator row
|
|
55
|
+
* (Commercial > Tools, in the sheet's place, under its id key-accounts). Owner, source and cadence stay in
|
|
55
56
|
* the sheet. Icons are glyph ids from the design system's NAV_ICONS, which
|
|
56
57
|
* draws them inline. Ids renamed in 0.3.0 are in OS_TOOL_ALIASES.
|
|
57
58
|
*
|
|
@@ -146,10 +147,11 @@ export const OS_MENU = {
|
|
|
146
147
|
tool("customer-scorecard", "Customer scorecard", "com-customer-scorecard", "No status"),
|
|
147
148
|
tool("margin-calculator", "Margin calculator", "com-margin-calculator", "In progress"),
|
|
148
149
|
tool("trade-marketing-calendar", "Trade marketing calendar", "com-trade-marketing-calendar", "To build"),
|
|
149
|
-
|
|
150
|
+
// The owner's sheet's Line form populator is our Key Accounts app (0.4.1, owner's yes of
|
|
151
|
+
// 4 Nov 2026): one row, under the app's id key-accounts, so its link and permissions stay.
|
|
152
|
+
tool("key-accounts", "Line form populator", "com-line-form-populator", "Live"),
|
|
150
153
|
tool("pricelist-generator", "Pricelist generator", "com-pricelist-generator", "To build"),
|
|
151
154
|
tool("clearance-list", "Clearance list", "com-clearance-list", "No status"),
|
|
152
|
-
tool("key-accounts", "Key accounts", "com-customer-scorecard", "Live"),
|
|
153
155
|
] },
|
|
154
156
|
],
|
|
155
157
|
operations: [
|
|
@@ -173,10 +175,11 @@ export const OS_MENU = {
|
|
|
173
175
|
],
|
|
174
176
|
};
|
|
175
177
|
/**
|
|
176
|
-
* Ids the menu map had before 0.3.0, and the
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
178
|
+
* Ids the menu map had before 0.3.0, and line-form-populator, the Hub's
|
|
179
|
+
* sample row until 0.4.1, and the row each is now: an app that still passes
|
|
180
|
+
* one (a tool of its own, a link, a reason it is locked) lands on the new
|
|
181
|
+
* row. Inventory value kept its id and moved to Finance in 0.3.0, as
|
|
182
|
+
* Inventory valuation, then back to Operations in 0.3.6.
|
|
180
183
|
*/
|
|
181
184
|
export const OS_TOOL_ALIASES = {
|
|
182
185
|
"pl-vs-budget": "pl-vs-ly",
|
|
@@ -184,8 +187,10 @@ export const OS_TOOL_ALIASES = {
|
|
|
184
187
|
"customer-otif": "order-otif",
|
|
185
188
|
"new-customer-acquisition": "customers",
|
|
186
189
|
"at-risk-customers": "customers",
|
|
190
|
+
// 0.4.1: the Hub's sample row Line form populator is the Key Accounts app's row.
|
|
191
|
+
"line-form-populator": "key-accounts",
|
|
187
192
|
};
|
|
188
|
-
/** The menu map's id for `id`: itself, or the row an id
|
|
193
|
+
/** The menu map's id for `id`: itself, or the row an old id (OS_TOOL_ALIASES) is now. */
|
|
189
194
|
export function osToolId(id) {
|
|
190
195
|
return Object.prototype.hasOwnProperty.call(OS_TOOL_ALIASES, id) ? OS_TOOL_ALIASES[id] : id;
|
|
191
196
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** This package's version, sent with each feedback message. A test keeps it equal to package.json. */
|
|
2
|
-
export declare const OS_VERSION = "0.4.
|
|
2
|
+
export declare const OS_VERSION = "0.4.2";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** This package's version, sent with each feedback message. A test keeps it equal to package.json. */
|
|
2
|
-
export const OS_VERSION = "0.4.
|
|
2
|
+
export const OS_VERSION = "0.4.2";
|
package/package.json
CHANGED