@cratis/showrunner.notes.react 0.0.0-stage → 1.15.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/Buttons/NotesButton.tsx +117 -0
- package/Buttons/index.ts +6 -0
- package/Buttons/menuItems.ts +55 -0
- package/Buttons/notesDialogHeaderActions.tsx +33 -0
- package/Context/componentContext.ts +57 -0
- package/Context/formatLocation.ts +27 -0
- package/Context/index.ts +6 -0
- package/Context/noteContext.ts +139 -0
- package/Feedback/ComponentFeedbackDialog.tsx +150 -0
- package/Feedback/ComponentModeSwitch.tsx +39 -0
- package/Feedback/ContextSummary.tsx +31 -0
- package/Feedback/FeedbackDialog.tsx +64 -0
- package/Feedback/KindAndText.tsx +38 -0
- package/Feedback/SliceChooser.tsx +90 -0
- package/Feedback/SlicesFeedbackDialog.tsx +63 -0
- package/Feedback/index.ts +13 -0
- package/Feedback/kindOptions.ts +35 -0
- package/Feedback/propertySuggestions.ts +38 -0
- package/Feedback/sliceChoice.ts +73 -0
- package/Icons.tsx +29 -0
- package/Labels/NotesLabels.ts +185 -0
- package/Labels/defaultNotesLabels.ts +93 -0
- package/Labels/format.ts +13 -0
- package/Labels/index.ts +7 -0
- package/Labels/resolveLabels.ts +36 -0
- package/MyFeedback/MyFeedbackDialog.tsx +51 -0
- package/MyFeedback/MyFeedbackList.tsx +62 -0
- package/MyFeedback/index.ts +6 -0
- package/MyFeedback/noteStates.ts +75 -0
- package/Provider/NotesContext.ts +111 -0
- package/Provider/NotesProvider.tsx +122 -0
- package/Provider/index.ts +6 -0
- package/Provider/notesVisibility.ts +13 -0
- package/README.md +49 -2
- package/dist/cjs/Buttons/NotesButton.d.ts +8 -0
- package/dist/cjs/Buttons/NotesButton.d.ts.map +1 -0
- package/dist/cjs/Buttons/NotesButton.js +126 -0
- package/dist/cjs/Buttons/NotesButton.js.map +1 -0
- package/dist/cjs/Buttons/index.d.ts +4 -0
- package/dist/cjs/Buttons/index.d.ts.map +1 -0
- package/dist/cjs/Buttons/menuItems.d.ts +10 -0
- package/dist/cjs/Buttons/menuItems.d.ts.map +1 -0
- package/dist/cjs/Buttons/menuItems.js +57 -0
- package/dist/cjs/Buttons/menuItems.js.map +1 -0
- package/dist/cjs/Buttons/notesDialogHeaderActions.d.ts +4 -0
- package/dist/cjs/Buttons/notesDialogHeaderActions.d.ts.map +1 -0
- package/dist/cjs/Buttons/notesDialogHeaderActions.js +37 -0
- package/dist/cjs/Buttons/notesDialogHeaderActions.js.map +1 -0
- package/dist/cjs/Context/componentContext.d.ts +8 -0
- package/dist/cjs/Context/componentContext.d.ts.map +1 -0
- package/dist/cjs/Context/componentContext.js +56 -0
- package/dist/cjs/Context/componentContext.js.map +1 -0
- package/dist/cjs/Context/formatLocation.d.ts +7 -0
- package/dist/cjs/Context/formatLocation.d.ts.map +1 -0
- package/dist/cjs/Context/formatLocation.js +23 -0
- package/dist/cjs/Context/formatLocation.js.map +1 -0
- package/dist/cjs/Context/index.d.ts +4 -0
- package/dist/cjs/Context/index.d.ts.map +1 -0
- package/dist/cjs/Context/noteContext.d.ts +22 -0
- package/dist/cjs/Context/noteContext.d.ts.map +1 -0
- package/dist/cjs/Context/noteContext.js +117 -0
- package/dist/cjs/Context/noteContext.js.map +1 -0
- package/dist/cjs/Feedback/ComponentFeedbackDialog.d.ts +10 -0
- package/dist/cjs/Feedback/ComponentFeedbackDialog.d.ts.map +1 -0
- package/dist/cjs/Feedback/ComponentFeedbackDialog.js +183 -0
- package/dist/cjs/Feedback/ComponentFeedbackDialog.js.map +1 -0
- package/dist/cjs/Feedback/ComponentModeSwitch.d.ts +7 -0
- package/dist/cjs/Feedback/ComponentModeSwitch.d.ts.map +1 -0
- package/dist/cjs/Feedback/ComponentModeSwitch.js +29 -0
- package/dist/cjs/Feedback/ComponentModeSwitch.js.map +1 -0
- package/dist/cjs/Feedback/ContextSummary.d.ts +7 -0
- package/dist/cjs/Feedback/ContextSummary.d.ts.map +1 -0
- package/dist/cjs/Feedback/ContextSummary.js +31 -0
- package/dist/cjs/Feedback/ContextSummary.js.map +1 -0
- package/dist/cjs/Feedback/FeedbackDialog.d.ts +11 -0
- package/dist/cjs/Feedback/FeedbackDialog.d.ts.map +1 -0
- package/dist/cjs/Feedback/FeedbackDialog.js +55 -0
- package/dist/cjs/Feedback/FeedbackDialog.js.map +1 -0
- package/dist/cjs/Feedback/KindAndText.d.ts +7 -0
- package/dist/cjs/Feedback/KindAndText.d.ts.map +1 -0
- package/dist/cjs/Feedback/KindAndText.js +33 -0
- package/dist/cjs/Feedback/KindAndText.js.map +1 -0
- package/dist/cjs/Feedback/SliceChooser.d.ts +9 -0
- package/dist/cjs/Feedback/SliceChooser.d.ts.map +1 -0
- package/dist/cjs/Feedback/SliceChooser.js +113 -0
- package/dist/cjs/Feedback/SliceChooser.js.map +1 -0
- package/dist/cjs/Feedback/SlicesFeedbackDialog.d.ts +8 -0
- package/dist/cjs/Feedback/SlicesFeedbackDialog.d.ts.map +1 -0
- package/dist/cjs/Feedback/SlicesFeedbackDialog.js +74 -0
- package/dist/cjs/Feedback/SlicesFeedbackDialog.js.map +1 -0
- package/dist/cjs/Feedback/index.d.ts +11 -0
- package/dist/cjs/Feedback/index.d.ts.map +1 -0
- package/dist/cjs/Feedback/kindOptions.d.ts +9 -0
- package/dist/cjs/Feedback/kindOptions.d.ts.map +1 -0
- package/dist/cjs/Feedback/kindOptions.js +37 -0
- package/dist/cjs/Feedback/kindOptions.js.map +1 -0
- package/dist/cjs/Feedback/propertySuggestions.d.ts +6 -0
- package/dist/cjs/Feedback/propertySuggestions.d.ts.map +1 -0
- package/dist/cjs/Feedback/propertySuggestions.js +32 -0
- package/dist/cjs/Feedback/propertySuggestions.js.map +1 -0
- package/dist/cjs/Feedback/sliceChoice.d.ts +7 -0
- package/dist/cjs/Feedback/sliceChoice.d.ts.map +1 -0
- package/dist/cjs/Feedback/sliceChoice.js +71 -0
- package/dist/cjs/Feedback/sliceChoice.js.map +1 -0
- package/dist/cjs/Icons.d.ts +4 -0
- package/dist/cjs/Icons.d.ts.map +1 -0
- package/dist/cjs/Icons.js +53 -0
- package/dist/cjs/Icons.js.map +1 -0
- package/dist/cjs/Labels/NotesLabels.d.ts +90 -0
- package/dist/cjs/Labels/NotesLabels.d.ts.map +1 -0
- package/dist/cjs/Labels/defaultNotesLabels.d.ts +3 -0
- package/dist/cjs/Labels/defaultNotesLabels.d.ts.map +1 -0
- package/dist/cjs/Labels/defaultNotesLabels.js +94 -0
- package/dist/cjs/Labels/defaultNotesLabels.js.map +1 -0
- package/dist/cjs/Labels/format.d.ts +2 -0
- package/dist/cjs/Labels/format.d.ts.map +1 -0
- package/dist/cjs/Labels/format.js +15 -0
- package/dist/cjs/Labels/format.js.map +1 -0
- package/dist/cjs/Labels/index.d.ts +5 -0
- package/dist/cjs/Labels/index.d.ts.map +1 -0
- package/dist/cjs/Labels/resolveLabels.d.ts +3 -0
- package/dist/cjs/Labels/resolveLabels.d.ts.map +1 -0
- package/dist/cjs/Labels/resolveLabels.js +35 -0
- package/dist/cjs/Labels/resolveLabels.js.map +1 -0
- package/dist/cjs/MyFeedback/MyFeedbackDialog.d.ts +2 -0
- package/dist/cjs/MyFeedback/MyFeedbackDialog.d.ts.map +1 -0
- package/dist/cjs/MyFeedback/MyFeedbackDialog.js +55 -0
- package/dist/cjs/MyFeedback/MyFeedbackDialog.js.map +1 -0
- package/dist/cjs/MyFeedback/MyFeedbackList.d.ts +10 -0
- package/dist/cjs/MyFeedback/MyFeedbackList.d.ts.map +1 -0
- package/dist/cjs/MyFeedback/MyFeedbackList.js +62 -0
- package/dist/cjs/MyFeedback/MyFeedbackList.js.map +1 -0
- package/dist/cjs/MyFeedback/index.d.ts +4 -0
- package/dist/cjs/MyFeedback/index.d.ts.map +1 -0
- package/dist/cjs/MyFeedback/noteStates.d.ts +8 -0
- package/dist/cjs/MyFeedback/noteStates.d.ts.map +1 -0
- package/dist/cjs/MyFeedback/noteStates.js +90 -0
- package/dist/cjs/MyFeedback/noteStates.js.map +1 -0
- package/dist/cjs/Provider/NotesContext.d.ts +23 -0
- package/dist/cjs/Provider/NotesContext.d.ts.map +1 -0
- package/dist/cjs/Provider/NotesContext.js +51 -0
- package/dist/cjs/Provider/NotesContext.js.map +1 -0
- package/dist/cjs/Provider/NotesProvider.d.ts +11 -0
- package/dist/cjs/Provider/NotesProvider.d.ts.map +1 -0
- package/dist/cjs/Provider/NotesProvider.js +133 -0
- package/dist/cjs/Provider/NotesProvider.js.map +1 -0
- package/dist/cjs/Provider/index.d.ts +4 -0
- package/dist/cjs/Provider/index.d.ts.map +1 -0
- package/dist/cjs/Provider/notesVisibility.d.ts +2 -0
- package/dist/cjs/Provider/notesVisibility.d.ts.map +1 -0
- package/dist/cjs/Provider/notesVisibility.js +16 -0
- package/dist/cjs/Provider/notesVisibility.js.map +1 -0
- package/dist/cjs/index.d.ts +8 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +85 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/esm/Buttons/NotesButton.d.ts +8 -0
- package/dist/esm/Buttons/NotesButton.d.ts.map +1 -0
- package/dist/esm/Buttons/NotesButton.js +124 -0
- package/dist/esm/Buttons/NotesButton.js.map +1 -0
- package/dist/esm/Buttons/index.d.ts +4 -0
- package/dist/esm/Buttons/index.d.ts.map +1 -0
- package/dist/esm/Buttons/index.js +4 -0
- package/dist/esm/Buttons/index.js.map +1 -0
- package/dist/esm/Buttons/menuItems.d.ts +10 -0
- package/dist/esm/Buttons/menuItems.d.ts.map +1 -0
- package/dist/esm/Buttons/menuItems.js +54 -0
- package/dist/esm/Buttons/menuItems.js.map +1 -0
- package/dist/esm/Buttons/notesDialogHeaderActions.d.ts +4 -0
- package/dist/esm/Buttons/notesDialogHeaderActions.d.ts.map +1 -0
- package/dist/esm/Buttons/notesDialogHeaderActions.js +34 -0
- package/dist/esm/Buttons/notesDialogHeaderActions.js.map +1 -0
- package/dist/esm/Context/componentContext.d.ts +8 -0
- package/dist/esm/Context/componentContext.d.ts.map +1 -0
- package/dist/esm/Context/componentContext.js +51 -0
- package/dist/esm/Context/componentContext.js.map +1 -0
- package/dist/esm/Context/formatLocation.d.ts +7 -0
- package/dist/esm/Context/formatLocation.d.ts.map +1 -0
- package/dist/esm/Context/formatLocation.js +21 -0
- package/dist/esm/Context/formatLocation.js.map +1 -0
- package/dist/esm/Context/index.d.ts +4 -0
- package/dist/esm/Context/index.d.ts.map +1 -0
- package/dist/esm/Context/index.js +4 -0
- package/dist/esm/Context/index.js.map +1 -0
- package/dist/esm/Context/noteContext.d.ts +22 -0
- package/dist/esm/Context/noteContext.d.ts.map +1 -0
- package/dist/esm/Context/noteContext.js +110 -0
- package/dist/esm/Context/noteContext.js.map +1 -0
- package/dist/esm/Feedback/ComponentFeedbackDialog.d.ts +10 -0
- package/dist/esm/Feedback/ComponentFeedbackDialog.d.ts.map +1 -0
- package/dist/esm/Feedback/ComponentFeedbackDialog.js +181 -0
- package/dist/esm/Feedback/ComponentFeedbackDialog.js.map +1 -0
- package/dist/esm/Feedback/ComponentModeSwitch.d.ts +7 -0
- package/dist/esm/Feedback/ComponentModeSwitch.d.ts.map +1 -0
- package/dist/esm/Feedback/ComponentModeSwitch.js +27 -0
- package/dist/esm/Feedback/ComponentModeSwitch.js.map +1 -0
- package/dist/esm/Feedback/ContextSummary.d.ts +7 -0
- package/dist/esm/Feedback/ContextSummary.d.ts.map +1 -0
- package/dist/esm/Feedback/ContextSummary.js +29 -0
- package/dist/esm/Feedback/ContextSummary.js.map +1 -0
- package/dist/esm/Feedback/FeedbackDialog.d.ts +11 -0
- package/dist/esm/Feedback/FeedbackDialog.d.ts.map +1 -0
- package/dist/esm/Feedback/FeedbackDialog.js +53 -0
- package/dist/esm/Feedback/FeedbackDialog.js.map +1 -0
- package/dist/esm/Feedback/KindAndText.d.ts +7 -0
- package/dist/esm/Feedback/KindAndText.d.ts.map +1 -0
- package/dist/esm/Feedback/KindAndText.js +31 -0
- package/dist/esm/Feedback/KindAndText.js.map +1 -0
- package/dist/esm/Feedback/SliceChooser.d.ts +9 -0
- package/dist/esm/Feedback/SliceChooser.d.ts.map +1 -0
- package/dist/esm/Feedback/SliceChooser.js +111 -0
- package/dist/esm/Feedback/SliceChooser.js.map +1 -0
- package/dist/esm/Feedback/SlicesFeedbackDialog.d.ts +8 -0
- package/dist/esm/Feedback/SlicesFeedbackDialog.d.ts.map +1 -0
- package/dist/esm/Feedback/SlicesFeedbackDialog.js +72 -0
- package/dist/esm/Feedback/SlicesFeedbackDialog.js.map +1 -0
- package/dist/esm/Feedback/index.d.ts +11 -0
- package/dist/esm/Feedback/index.d.ts.map +1 -0
- package/dist/esm/Feedback/index.js +11 -0
- package/dist/esm/Feedback/index.js.map +1 -0
- package/dist/esm/Feedback/kindOptions.d.ts +9 -0
- package/dist/esm/Feedback/kindOptions.d.ts.map +1 -0
- package/dist/esm/Feedback/kindOptions.js +34 -0
- package/dist/esm/Feedback/kindOptions.js.map +1 -0
- package/dist/esm/Feedback/propertySuggestions.d.ts +6 -0
- package/dist/esm/Feedback/propertySuggestions.d.ts.map +1 -0
- package/dist/esm/Feedback/propertySuggestions.js +29 -0
- package/dist/esm/Feedback/propertySuggestions.js.map +1 -0
- package/dist/esm/Feedback/sliceChoice.d.ts +7 -0
- package/dist/esm/Feedback/sliceChoice.d.ts.map +1 -0
- package/dist/esm/Feedback/sliceChoice.js +65 -0
- package/dist/esm/Feedback/sliceChoice.js.map +1 -0
- package/dist/esm/Icons.d.ts +4 -0
- package/dist/esm/Icons.d.ts.map +1 -0
- package/dist/esm/Icons.js +49 -0
- package/dist/esm/Icons.js.map +1 -0
- package/dist/esm/Labels/NotesLabels.d.ts +90 -0
- package/dist/esm/Labels/NotesLabels.d.ts.map +1 -0
- package/dist/esm/Labels/NotesLabels.js +2 -0
- package/dist/esm/Labels/NotesLabels.js.map +1 -0
- package/dist/esm/Labels/defaultNotesLabels.d.ts +3 -0
- package/dist/esm/Labels/defaultNotesLabels.d.ts.map +1 -0
- package/dist/esm/Labels/defaultNotesLabels.js +92 -0
- package/dist/esm/Labels/defaultNotesLabels.js.map +1 -0
- package/dist/esm/Labels/format.d.ts +2 -0
- package/dist/esm/Labels/format.d.ts.map +1 -0
- package/dist/esm/Labels/format.js +13 -0
- package/dist/esm/Labels/format.js.map +1 -0
- package/dist/esm/Labels/index.d.ts +5 -0
- package/dist/esm/Labels/index.d.ts.map +1 -0
- package/dist/esm/Labels/index.js +5 -0
- package/dist/esm/Labels/index.js.map +1 -0
- package/dist/esm/Labels/resolveLabels.d.ts +3 -0
- package/dist/esm/Labels/resolveLabels.d.ts.map +1 -0
- package/dist/esm/Labels/resolveLabels.js +33 -0
- package/dist/esm/Labels/resolveLabels.js.map +1 -0
- package/dist/esm/MyFeedback/MyFeedbackDialog.d.ts +2 -0
- package/dist/esm/MyFeedback/MyFeedbackDialog.d.ts.map +1 -0
- package/dist/esm/MyFeedback/MyFeedbackDialog.js +53 -0
- package/dist/esm/MyFeedback/MyFeedbackDialog.js.map +1 -0
- package/dist/esm/MyFeedback/MyFeedbackList.d.ts +10 -0
- package/dist/esm/MyFeedback/MyFeedbackList.d.ts.map +1 -0
- package/dist/esm/MyFeedback/MyFeedbackList.js +60 -0
- package/dist/esm/MyFeedback/MyFeedbackList.js.map +1 -0
- package/dist/esm/MyFeedback/index.d.ts +4 -0
- package/dist/esm/MyFeedback/index.d.ts.map +1 -0
- package/dist/esm/MyFeedback/index.js +4 -0
- package/dist/esm/MyFeedback/index.js.map +1 -0
- package/dist/esm/MyFeedback/noteStates.d.ts +8 -0
- package/dist/esm/MyFeedback/noteStates.d.ts.map +1 -0
- package/dist/esm/MyFeedback/noteStates.js +84 -0
- package/dist/esm/MyFeedback/noteStates.js.map +1 -0
- package/dist/esm/Provider/NotesContext.d.ts +23 -0
- package/dist/esm/Provider/NotesContext.d.ts.map +1 -0
- package/dist/esm/Provider/NotesContext.js +44 -0
- package/dist/esm/Provider/NotesContext.js.map +1 -0
- package/dist/esm/Provider/NotesProvider.d.ts +11 -0
- package/dist/esm/Provider/NotesProvider.d.ts.map +1 -0
- package/dist/esm/Provider/NotesProvider.js +131 -0
- package/dist/esm/Provider/NotesProvider.js.map +1 -0
- package/dist/esm/Provider/index.d.ts +4 -0
- package/dist/esm/Provider/index.d.ts.map +1 -0
- package/dist/esm/Provider/index.js +4 -0
- package/dist/esm/Provider/index.js.map +1 -0
- package/dist/esm/Provider/notesVisibility.d.ts +2 -0
- package/dist/esm/Provider/notesVisibility.d.ts.map +1 -0
- package/dist/esm/Provider/notesVisibility.js +14 -0
- package/dist/esm/Provider/notesVisibility.js.map +1 -0
- package/dist/esm/index.d.ts +8 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +27 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/index.ts +10 -0
- package/package.json +83 -4
- package/styles.css +192 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var dialogs = require('@cratis/arc.react/dialogs');
|
|
5
|
+
var CommandDialog = require('@cratis/components/CommandDialog');
|
|
6
|
+
var Dialogs = require('@cratis/components/Dialogs');
|
|
7
|
+
var fundamentals = require('@cratis/fundamentals');
|
|
8
|
+
var showrunner_notes = require('@cratis/showrunner.notes');
|
|
9
|
+
var react = require('react');
|
|
10
|
+
var noteContext = require('../Context/noteContext.js');
|
|
11
|
+
var NotesContext = require('../Provider/NotesContext.js');
|
|
12
|
+
var ContextSummary = require('./ContextSummary.js');
|
|
13
|
+
var kindOptions = require('./kindOptions.js');
|
|
14
|
+
var KindAndText = require('./KindAndText.js');
|
|
15
|
+
var SliceChooser = require('./SliceChooser.js');
|
|
16
|
+
var sliceChoice = require('./sliceChoice.js');
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The give feedback on specific slices dialog: the user chooses among the slices active on the screen and searches
|
|
20
|
+
* all the slices the host knows. It sends `GiveNoteOnSlices` and closes with {@link FeedbackGiven}. Open it with
|
|
21
|
+
* `useDialog`.
|
|
22
|
+
*/ const SlicesFeedbackDialog = ({ context, knownSlices = [] })=>{
|
|
23
|
+
const { labels } = NotesContext.useNotesContext();
|
|
24
|
+
const { closeDialog } = dialogs.useDialogContext();
|
|
25
|
+
const [noteId] = react.useState(()=>fundamentals.Guid.create());
|
|
26
|
+
const active = react.useMemo(()=>sliceChoice.distinctSlices([
|
|
27
|
+
context.location,
|
|
28
|
+
...context.activeSlices
|
|
29
|
+
]), [
|
|
30
|
+
context
|
|
31
|
+
]);
|
|
32
|
+
const [chosen, setChosen] = react.useState([]);
|
|
33
|
+
const currentValues = react.useMemo(()=>({
|
|
34
|
+
slices: chosen.map(noteContext.toSliceLocation)
|
|
35
|
+
}), [
|
|
36
|
+
chosen
|
|
37
|
+
]);
|
|
38
|
+
return /*#__PURE__*/ jsxRuntime.jsx(CommandDialog.CommandDialog, {
|
|
39
|
+
command: showrunner_notes.GiveNoteOnSlices,
|
|
40
|
+
title: labels.slices.title,
|
|
41
|
+
okLabel: labels.feedback.send,
|
|
42
|
+
cancelLabel: labels.common.cancel,
|
|
43
|
+
closeAriaLabel: labels.common.close,
|
|
44
|
+
width: "640px",
|
|
45
|
+
initialFocus: Dialogs.DialogInitialFocus.Content,
|
|
46
|
+
initialValues: {
|
|
47
|
+
context,
|
|
48
|
+
noteId,
|
|
49
|
+
kind: kindOptions.defaultKind
|
|
50
|
+
},
|
|
51
|
+
currentValues: currentValues,
|
|
52
|
+
onSuccess: ()=>closeDialog(dialogs.DialogResult.Ok, {
|
|
53
|
+
noteId
|
|
54
|
+
}),
|
|
55
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
56
|
+
className: "notes-feedback-form",
|
|
57
|
+
children: [
|
|
58
|
+
/*#__PURE__*/ jsxRuntime.jsx(ContextSummary.ContextSummary, {
|
|
59
|
+
text: noteContext.describeContext(context, labels)
|
|
60
|
+
}),
|
|
61
|
+
/*#__PURE__*/ jsxRuntime.jsx(SliceChooser.SliceChooser, {
|
|
62
|
+
active: active,
|
|
63
|
+
known: knownSlices,
|
|
64
|
+
chosen: chosen,
|
|
65
|
+
onChange: setChosen
|
|
66
|
+
}),
|
|
67
|
+
/*#__PURE__*/ jsxRuntime.jsx(KindAndText.KindAndText, {})
|
|
68
|
+
]
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
exports.SlicesFeedbackDialog = SlicesFeedbackDialog;
|
|
74
|
+
//# sourceMappingURL=SlicesFeedbackDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlicesFeedbackDialog.js","sources":["../../../Feedback/SlicesFeedbackDialog.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DialogResult, useDialogContext } from '@cratis/arc.react/dialogs';\nimport { CommandDialog } from '@cratis/components/CommandDialog';\nimport { DialogInitialFocus } from '@cratis/components/Dialogs';\nimport { Guid } from '@cratis/fundamentals';\nimport { GiveNoteOnSlices, NoteContext } from '@cratis/showrunner.notes';\nimport { useMemo, useState } from 'react';\nimport { describeContext, toSliceLocation } from '../Context/index.js';\nimport { LocationParts } from '../Context/formatLocation.js';\nimport { useNotesContext } from '../Provider/NotesContext.js';\nimport { ContextSummary } from './ContextSummary.js';\nimport { FeedbackGiven } from './FeedbackDialog.js';\nimport { defaultKind } from './kindOptions.js';\nimport { KindAndText } from './KindAndText.js';\nimport { SliceChooser } from './SliceChooser.js';\nimport { distinctSlices } from './sliceChoice.js';\n\n/**\n * Props for {@link SlicesFeedbackDialog}.\n */\nexport interface SlicesFeedbackDialogProps {\n /** What the user was looking at when they chose to give feedback. */\n context: NoteContext;\n\n /** Every slice the host knows about, to search over. */\n knownSlices?: readonly LocationParts[];\n}\n\n/**\n * The give feedback on specific slices dialog: the user chooses among the slices active on the screen and searches\n * all the slices the host knows. It sends `GiveNoteOnSlices` and closes with {@link FeedbackGiven}. Open it with\n * `useDialog`.\n */\nexport const SlicesFeedbackDialog = ({ context, knownSlices = [] }: SlicesFeedbackDialogProps) => {\n const { labels } = useNotesContext();\n const { closeDialog } = useDialogContext<SlicesFeedbackDialogProps, FeedbackGiven>();\n const [noteId] = useState(() => Guid.create());\n const active = useMemo(() => distinctSlices([context.location, ...context.activeSlices]), [context]);\n const [chosen, setChosen] = useState<LocationParts[]>([]);\n const currentValues = useMemo(() => ({ slices: chosen.map(toSliceLocation) }), [chosen]);\n\n return (\n <CommandDialog<GiveNoteOnSlices>\n command={GiveNoteOnSlices}\n title={labels.slices.title}\n okLabel={labels.feedback.send}\n cancelLabel={labels.common.cancel}\n closeAriaLabel={labels.common.close}\n width='640px'\n initialFocus={DialogInitialFocus.Content}\n initialValues={{ context, noteId, kind: defaultKind }}\n currentValues={currentValues}\n onSuccess={() => closeDialog(DialogResult.Ok, { noteId })}>\n <div className='notes-feedback-form'>\n <ContextSummary text={describeContext(context, labels)} />\n <SliceChooser active={active} known={knownSlices} chosen={chosen} onChange={setChosen} />\n <KindAndText<GiveNoteOnSlices> />\n </div>\n </CommandDialog>\n );\n};\n"],"names":["SlicesFeedbackDialog","context","knownSlices","labels","useNotesContext","closeDialog","useDialogContext","noteId","useState","Guid","create","active","useMemo","distinctSlices","location","activeSlices","chosen","setChosen","currentValues","slices","map","toSliceLocation","_jsx","CommandDialog","command","GiveNoteOnSlices","title","okLabel","feedback","send","cancelLabel","common","cancel","closeAriaLabel","close","width","initialFocus","DialogInitialFocus","Content","initialValues","kind","defaultKind","onSuccess","DialogResult","Ok","_jsxs","div","className","ContextSummary","text","describeContext","SliceChooser","known","onChange","KindAndText"],"mappings":";;;;;;;;;;;;;;;;;AA8BA;;;;UAKaA,oBAAAA,GAAuB,CAAC,EAAEC,OAAO,EAAEC,WAAAA,GAAc,EAAE,EAA6B,GAAA;IACzF,MAAM,EAAEC,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AA,QAAA,gBAAAsC,eAAA,CAACC,KAAAA,EAAAA;YAAIC,SAAAA,EAAU,qBAAA;;8BACXzB,cAAA,CAAC0B,6BAAAA,EAAAA;AAAeC,oBAAAA,IAAAA,EAAMC,4BAAgBjD,OAAAA,EAASE,MAAAA;;8BAC/CmB,cAAA,CAAC6B,yBAAAA,EAAAA;oBAAaxC,MAAAA,EAAQA,MAAAA;oBAAQyC,KAAAA,EAAOlD,WAAAA;oBAAac,MAAAA,EAAQA,MAAAA;oBAAQqC,QAAAA,EAAUpC;;8BAC5EK,cAAA,CAACgC,uBAAAA,EAAAA,EAAAA;;;;AAIjB;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './ComponentFeedbackDialog.js';
|
|
2
|
+
export * from './ComponentModeSwitch.js';
|
|
3
|
+
export * from './ContextSummary.js';
|
|
4
|
+
export * from './FeedbackDialog.js';
|
|
5
|
+
export * from './kindOptions.js';
|
|
6
|
+
export * from './KindAndText.js';
|
|
7
|
+
export * from './propertySuggestions.js';
|
|
8
|
+
export * from './SliceChooser.js';
|
|
9
|
+
export * from './SlicesFeedbackDialog.js';
|
|
10
|
+
export * from './sliceChoice.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Feedback/index.ts"],"names":[],"mappings":"AAGA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NoteKind } from '@cratis/showrunner.notes';
|
|
2
|
+
import { NotesLabels } from '../Labels/index.js';
|
|
3
|
+
export type KindOption = {
|
|
4
|
+
readonly value: NoteKind;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function kindOptions(labels: NotesLabels): KindOption[];
|
|
8
|
+
export declare const defaultKind: NoteKind;
|
|
9
|
+
//# sourceMappingURL=kindOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kindOptions.d.ts","sourceRoot":"","sources":["../../../Feedback/kindOptions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAKjD,MAAM,MAAM,UAAU,GAAG;IAErB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IAGzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CAC1B,CAAC;AAOF,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,UAAU,EAAE,CAO7D;AAKD,eAAO,MAAM,WAAW,EAAE,QAA8B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var showrunner_notes = require('@cratis/showrunner.notes');
|
|
4
|
+
|
|
5
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
6
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
7
|
+
/**
|
|
8
|
+
* Gets the kinds of feedback a user can choose from.
|
|
9
|
+
* @param labels The labels to show.
|
|
10
|
+
* @returns The {@link KindOption}s, in the order they are offered.
|
|
11
|
+
*/ function kindOptions(labels) {
|
|
12
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
value: showrunner_notes.NoteKind.problem,
|
|
15
|
+
label: labels.kinds.problem
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
value: showrunner_notes.NoteKind.suggestion,
|
|
19
|
+
label: labels.kinds.suggestion
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: showrunner_notes.NoteKind.question,
|
|
23
|
+
label: labels.kinds.question
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
value: showrunner_notes.NoteKind.praise,
|
|
27
|
+
label: labels.kinds.praise
|
|
28
|
+
}
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The kind a note starts as.
|
|
33
|
+
*/ const defaultKind = showrunner_notes.NoteKind.suggestion;
|
|
34
|
+
|
|
35
|
+
exports.defaultKind = defaultKind;
|
|
36
|
+
exports.kindOptions = kindOptions;
|
|
37
|
+
//# sourceMappingURL=kindOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kindOptions.js","sources":["../../../Feedback/kindOptions.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { NoteKind } from '@cratis/showrunner.notes';\nimport { NotesLabels } from '../Labels/index.js';\n\n/**\n * One choice of the kind field.\n */\nexport type KindOption = {\n /** The kind. */\n readonly value: NoteKind;\n\n /** The label. */\n readonly label: string;\n};\n\n/**\n * Gets the kinds of feedback a user can choose from.\n * @param labels The labels to show.\n * @returns The {@link KindOption}s, in the order they are offered.\n */\nexport function kindOptions(labels: NotesLabels): KindOption[] {\n return [\n { value: NoteKind.problem, label: labels.kinds.problem },\n { value: NoteKind.suggestion, label: labels.kinds.suggestion },\n { value: NoteKind.question, label: labels.kinds.question },\n { value: NoteKind.praise, label: labels.kinds.praise }\n ];\n}\n\n/**\n * The kind a note starts as.\n */\nexport const defaultKind: NoteKind = NoteKind.suggestion;\n"],"names":["kindOptions","labels","value","NoteKind","problem","label","kinds","suggestion","question","praise","defaultKind"],"mappings":";;;;AAAA;AACA;AAgBA;;;;IAKO,SAASA,WAAAA,CAAYC,MAAmB,EAAA;IAC3C,OAAO;AACH,QAAA;AAAEC,YAAAA,KAAAA,EAAOC,0BAASC,OAAO;YAAEC,KAAAA,EAAOJ,MAAAA,CAAOK,KAAK,CAACF;AAAQ,SAAA;AACvD,QAAA;AAAEF,YAAAA,KAAAA,EAAOC,0BAASI,UAAU;YAAEF,KAAAA,EAAOJ,MAAAA,CAAOK,KAAK,CAACC;AAAW,SAAA;AAC7D,QAAA;AAAEL,YAAAA,KAAAA,EAAOC,0BAASK,QAAQ;YAAEH,KAAAA,EAAOJ,MAAAA,CAAOK,KAAK,CAACE;AAAS,SAAA;AACzD,QAAA;AAAEN,YAAAA,KAAAA,EAAOC,0BAASM,MAAM;YAAEJ,KAAAA,EAAOJ,MAAAA,CAAOK,KAAK,CAACG;AAAO;AACxD,KAAA;AACL;AAEA;;AAEC,IACM,MAAMC,WAAAA,GAAwBP,yBAAAA,CAASI;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PresentationChange } from '@cratis/components/ComponentPicker';
|
|
2
|
+
import { Guid } from '@cratis/fundamentals';
|
|
3
|
+
import { ISuggestComponentPropertyChange, NoteContext, PickedComponent } from '@cratis/showrunner.notes';
|
|
4
|
+
export declare function propertyValueText(value: unknown): string;
|
|
5
|
+
export declare function propertySuggestions(changes: readonly PresentationChange[], context: NoteContext, component: PickedComponent, noteId: Guid): ISuggestComponentPropertyChange[];
|
|
6
|
+
//# sourceMappingURL=propertySuggestions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propertySuggestions.d.ts","sourceRoot":"","sources":["../../../Feedback/propertySuggestions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,+BAA+B,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAOzG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAExD;AAUD,wBAAgB,mBAAmB,CAC/B,OAAO,EAAE,SAAS,kBAAkB,EAAE,EACtC,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,eAAe,EAC1B,MAAM,EAAE,IAAI,GAAG,+BAA+B,EAAE,CASnD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/**
|
|
6
|
+
* Turns the value of a presentation property into the text a suggestion carries.
|
|
7
|
+
* @param value The value; undefined when the property was not set.
|
|
8
|
+
* @returns The text; empty when the property was not set.
|
|
9
|
+
*/ function propertyValueText(value) {
|
|
10
|
+
return value === undefined || value === null ? '' : String(value);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Makes the values of one `SuggestComponentPropertyChange` per changed property.
|
|
14
|
+
* @param changes What the user changed in the property editor.
|
|
15
|
+
* @param context What the user was looking at.
|
|
16
|
+
* @param component The picked component.
|
|
17
|
+
* @param noteId The id the whole picking session shares.
|
|
18
|
+
* @returns The command values, in the order of the changes.
|
|
19
|
+
*/ function propertySuggestions(changes, context, component, noteId) {
|
|
20
|
+
return changes.map((change)=>({
|
|
21
|
+
noteId,
|
|
22
|
+
context,
|
|
23
|
+
component,
|
|
24
|
+
property: change.property,
|
|
25
|
+
currentValue: propertyValueText(change.from),
|
|
26
|
+
suggestedValue: propertyValueText(change.to)
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.propertySuggestions = propertySuggestions;
|
|
31
|
+
exports.propertyValueText = propertyValueText;
|
|
32
|
+
//# sourceMappingURL=propertySuggestions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propertySuggestions.js","sources":["../../../Feedback/propertySuggestions.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PresentationChange } from '@cratis/components/ComponentPicker';\nimport { Guid } from '@cratis/fundamentals';\nimport { ISuggestComponentPropertyChange, NoteContext, PickedComponent } from '@cratis/showrunner.notes';\n\n/**\n * Turns the value of a presentation property into the text a suggestion carries.\n * @param value The value; undefined when the property was not set.\n * @returns The text; empty when the property was not set.\n */\nexport function propertyValueText(value: unknown): string {\n return value === undefined || value === null ? '' : String(value);\n}\n\n/**\n * Makes the values of one `SuggestComponentPropertyChange` per changed property.\n * @param changes What the user changed in the property editor.\n * @param context What the user was looking at.\n * @param component The picked component.\n * @param noteId The id the whole picking session shares.\n * @returns The command values, in the order of the changes.\n */\nexport function propertySuggestions(\n changes: readonly PresentationChange[],\n context: NoteContext,\n component: PickedComponent,\n noteId: Guid): ISuggestComponentPropertyChange[] {\n return changes.map(change => ({\n noteId,\n context,\n component,\n property: change.property,\n currentValue: propertyValueText(change.from),\n suggestedValue: propertyValueText(change.to)\n }));\n}\n"],"names":["propertyValueText","value","undefined","String","propertySuggestions","changes","context","component","noteId","map","change","property","currentValue","from","suggestedValue","to"],"mappings":";;AAAA;AACA;AAMA;;;;IAKO,SAASA,iBAAAA,CAAkBC,KAAc,EAAA;AAC5C,IAAA,OAAOA,KAAAA,KAAUC,SAAAA,IAAaD,KAAAA,KAAU,IAAA,GAAO,KAAKE,MAAAA,CAAOF,KAAAA,CAAAA;AAC/D;AAEA;;;;;;;IAQO,SAASG,mBAAAA,CACZC,OAAsC,EACtCC,OAAoB,EACpBC,SAA0B,EAC1BC,MAAY,EAAA;AACZ,IAAA,OAAOH,OAAAA,CAAQI,GAAG,CAACC,CAAAA,UAAW;AAC1BF,YAAAA,MAAAA;AACAF,YAAAA,OAAAA;AACAC,YAAAA,SAAAA;AACAI,YAAAA,QAAAA,EAAUD,OAAOC,QAAQ;YACzBC,YAAAA,EAAcZ,iBAAAA,CAAkBU,OAAOG,IAAI,CAAA;YAC3CC,cAAAA,EAAgBd,iBAAAA,CAAkBU,OAAOK,EAAE;SAC/C,CAAA,CAAA;AACJ;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LocationParts } from '../Context/formatLocation.js';
|
|
2
|
+
export declare function sliceKey(location: LocationParts): string;
|
|
3
|
+
export declare function distinctSlices<TLocation extends LocationParts>(locations: readonly TLocation[]): TLocation[];
|
|
4
|
+
export declare function toggleSlice<TLocation extends LocationParts>(chosen: readonly TLocation[], location: TLocation): TLocation[];
|
|
5
|
+
export declare function isChosen(chosen: readonly LocationParts[], location: LocationParts): boolean;
|
|
6
|
+
export declare function searchSlices<TLocation extends LocationParts>(known: readonly TLocation[], query: string): TLocation[];
|
|
7
|
+
//# sourceMappingURL=sliceChoice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliceChoice.d.ts","sourceRoot":"","sources":["../../../Feedback/sliceChoice.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAO7E,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAExD;AAOD,wBAAgB,cAAc,CAAC,SAAS,SAAS,aAAa,EAAE,SAAS,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,EAAE,CAW5G;AAQD,wBAAgB,WAAW,CAAC,SAAS,SAAS,aAAa,EAAE,MAAM,EAAE,SAAS,SAAS,EAAE,EAAE,QAAQ,EAAE,SAAS,GAAG,SAAS,EAAE,CAK3H;AAQD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAG3F;AAQD,wBAAgB,YAAY,CAAC,SAAS,SAAS,aAAa,EAAE,KAAK,EAAE,SAAS,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,CAUrH"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var formatLocation = require('../Context/formatLocation.js');
|
|
4
|
+
|
|
5
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
6
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
7
|
+
/**
|
|
8
|
+
* Gets what identifies a slice location.
|
|
9
|
+
* @param location The location.
|
|
10
|
+
* @returns A key that is the same for the same location.
|
|
11
|
+
*/ function sliceKey(location) {
|
|
12
|
+
return `${location.module}/${location.feature}/${location.slice}`;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Removes the slices that repeat an earlier one, and the ones that are empty.
|
|
16
|
+
* @param locations The locations.
|
|
17
|
+
* @returns The distinct, non-empty locations in their order.
|
|
18
|
+
*/ function distinctSlices(locations) {
|
|
19
|
+
const seen = new Set();
|
|
20
|
+
return locations.filter((location)=>{
|
|
21
|
+
const key = sliceKey(location);
|
|
22
|
+
if (key === '//' || seen.has(key)) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
seen.add(key);
|
|
26
|
+
return true;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Adds a slice to the chosen ones, or removes it when it is chosen already.
|
|
31
|
+
* @param chosen The chosen slices.
|
|
32
|
+
* @param location The slice to toggle.
|
|
33
|
+
* @returns The chosen slices after the toggle.
|
|
34
|
+
*/ function toggleSlice(chosen, location) {
|
|
35
|
+
const key = sliceKey(location);
|
|
36
|
+
return chosen.some((slice)=>sliceKey(slice) === key) ? chosen.filter((slice)=>sliceKey(slice) !== key) : [
|
|
37
|
+
...chosen,
|
|
38
|
+
location
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Whether a slice is among the chosen ones.
|
|
43
|
+
* @param chosen The chosen slices.
|
|
44
|
+
* @param location The slice.
|
|
45
|
+
* @returns True when it is chosen.
|
|
46
|
+
*/ function isChosen(chosen, location) {
|
|
47
|
+
const key = sliceKey(location);
|
|
48
|
+
return chosen.some((slice)=>sliceKey(slice) === key);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Searches the slices the host knows about.
|
|
52
|
+
* @param known Every slice the host knows about.
|
|
53
|
+
* @param query What the user typed; every word has to be part of the module, feature or slice.
|
|
54
|
+
* @returns The distinct slices that match; none for an empty query.
|
|
55
|
+
*/ function searchSlices(known, query) {
|
|
56
|
+
const words = query.toLowerCase().split(/\s+/).filter((word)=>word.length > 0);
|
|
57
|
+
if (words.length === 0) {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
return distinctSlices(known).filter((location)=>{
|
|
61
|
+
const text = formatLocation.formatLocation(location, ' ', '').toLowerCase();
|
|
62
|
+
return words.every((word)=>text.includes(word));
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
exports.distinctSlices = distinctSlices;
|
|
67
|
+
exports.isChosen = isChosen;
|
|
68
|
+
exports.searchSlices = searchSlices;
|
|
69
|
+
exports.sliceKey = sliceKey;
|
|
70
|
+
exports.toggleSlice = toggleSlice;
|
|
71
|
+
//# sourceMappingURL=sliceChoice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliceChoice.js","sources":["../../../Feedback/sliceChoice.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { formatLocation, LocationParts } from '../Context/formatLocation.js';\n\n/**\n * Gets what identifies a slice location.\n * @param location The location.\n * @returns A key that is the same for the same location.\n */\nexport function sliceKey(location: LocationParts): string {\n return `${location.module}/${location.feature}/${location.slice}`;\n}\n\n/**\n * Removes the slices that repeat an earlier one, and the ones that are empty.\n * @param locations The locations.\n * @returns The distinct, non-empty locations in their order.\n */\nexport function distinctSlices<TLocation extends LocationParts>(locations: readonly TLocation[]): TLocation[] {\n const seen = new Set<string>();\n return locations.filter(location => {\n const key = sliceKey(location);\n if (key === '//' || seen.has(key)) {\n return false;\n }\n\n seen.add(key);\n return true;\n });\n}\n\n/**\n * Adds a slice to the chosen ones, or removes it when it is chosen already.\n * @param chosen The chosen slices.\n * @param location The slice to toggle.\n * @returns The chosen slices after the toggle.\n */\nexport function toggleSlice<TLocation extends LocationParts>(chosen: readonly TLocation[], location: TLocation): TLocation[] {\n const key = sliceKey(location);\n return chosen.some(slice => sliceKey(slice) === key)\n ? chosen.filter(slice => sliceKey(slice) !== key)\n : [...chosen, location];\n}\n\n/**\n * Whether a slice is among the chosen ones.\n * @param chosen The chosen slices.\n * @param location The slice.\n * @returns True when it is chosen.\n */\nexport function isChosen(chosen: readonly LocationParts[], location: LocationParts): boolean {\n const key = sliceKey(location);\n return chosen.some(slice => sliceKey(slice) === key);\n}\n\n/**\n * Searches the slices the host knows about.\n * @param known Every slice the host knows about.\n * @param query What the user typed; every word has to be part of the module, feature or slice.\n * @returns The distinct slices that match; none for an empty query.\n */\nexport function searchSlices<TLocation extends LocationParts>(known: readonly TLocation[], query: string): TLocation[] {\n const words = query.toLowerCase().split(/\\s+/).filter(word => word.length > 0);\n if (words.length === 0) {\n return [];\n }\n\n return distinctSlices(known).filter(location => {\n const text = formatLocation(location, ' ', '').toLowerCase();\n return words.every(word => text.includes(word));\n });\n}\n"],"names":["sliceKey","location","module","feature","slice","distinctSlices","locations","seen","Set","filter","key","has","add","toggleSlice","chosen","some","isChosen","searchSlices","known","query","words","toLowerCase","split","word","length","text","formatLocation","every","includes"],"mappings":";;;;AAAA;AACA;AAIA;;;;IAKO,SAASA,QAAAA,CAASC,QAAuB,EAAA;AAC5C,IAAA,OAAO,CAAA,EAAGA,QAAAA,CAASC,MAAM,CAAC,CAAC,EAAED,QAAAA,CAASE,OAAO,CAAC,CAAC,EAAEF,QAAAA,CAASG,KAAK,CAAA,CAAE;AACrE;AAEA;;;;IAKO,SAASC,cAAAA,CAAgDC,SAA+B,EAAA;AAC3F,IAAA,MAAMC,OAAO,IAAIC,GAAAA,EAAAA;IACjB,OAAOF,SAAAA,CAAUG,MAAM,CAACR,CAAAA,QAAAA,GAAAA;AACpB,QAAA,MAAMS,MAAMV,QAAAA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AAea,KAAAA,CAAAA,CAAOT,MAAM,CAACR,CAAAA,QAAAA,GAAAA;AAChC,QAAA,MAAMwB,IAAAA,GAAOC,6BAAAA,CAAezB,QAAAA,EAAU,GAAA,EAAK,IAAIoB,WAAW,EAAA;AAC1D,QAAA,OAAOD,MAAMO,KAAK,CAACJ,CAAAA,IAAAA,GAAQE,IAAAA,CAAKG,QAAQ,CAACL,IAAAA,CAAAA,CAAAA;AAC7C,IAAA,CAAA,CAAA;AACJ;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icons.d.ts","sourceRoot":"","sources":["../../Icons.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,mCAIxB,CAAC;AAKF,eAAO,MAAM,WAAW,mCAIvB,CAAC;AAKF,eAAO,MAAM,SAAS,mCAIrB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
|
|
5
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
6
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
7
|
+
/**
|
|
8
|
+
* The speech bubble icon of the feedback button. Decorative: the button carries the accessible name.
|
|
9
|
+
*/ const FeedbackIcon = ()=>/*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
10
|
+
className: "notes-icon",
|
|
11
|
+
viewBox: "0 0 24 24",
|
|
12
|
+
width: "1em",
|
|
13
|
+
height: "1em",
|
|
14
|
+
"aria-hidden": "true",
|
|
15
|
+
focusable: "false",
|
|
16
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
17
|
+
fill: "currentColor",
|
|
18
|
+
d: "M20 2H4a2 2 0 0 0-2 2v18l4-4h14a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zm0 14H5.17L4 17.17V4h16v12z"
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* The chevron of the drop-down toggle. Decorative: the toggle carries the accessible name.
|
|
23
|
+
*/ const ChevronIcon = ()=>/*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
24
|
+
className: "notes-icon",
|
|
25
|
+
viewBox: "0 0 24 24",
|
|
26
|
+
width: "1em",
|
|
27
|
+
height: "1em",
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
focusable: "false",
|
|
30
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
31
|
+
fill: "currentColor",
|
|
32
|
+
d: "M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* The close icon of a chosen slice's remove button. Decorative: the button carries the accessible name.
|
|
37
|
+
*/ const CloseIcon = ()=>/*#__PURE__*/ jsxRuntime.jsx("svg", {
|
|
38
|
+
className: "notes-icon",
|
|
39
|
+
viewBox: "0 0 24 24",
|
|
40
|
+
width: "1em",
|
|
41
|
+
height: "1em",
|
|
42
|
+
"aria-hidden": "true",
|
|
43
|
+
focusable: "false",
|
|
44
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
45
|
+
fill: "currentColor",
|
|
46
|
+
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
exports.ChevronIcon = ChevronIcon;
|
|
51
|
+
exports.CloseIcon = CloseIcon;
|
|
52
|
+
exports.FeedbackIcon = FeedbackIcon;
|
|
53
|
+
//# sourceMappingURL=Icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icons.js","sources":["../../Icons.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The speech bubble icon of the feedback button. Decorative: the button carries the accessible name.\n */\nexport const FeedbackIcon = () => (\n <svg className='notes-icon' viewBox='0 0 24 24' width='1em' height='1em' aria-hidden='true' focusable='false'>\n <path fill='currentColor' d='M20 2H4a2 2 0 0 0-2 2v18l4-4h14a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zm0 14H5.17L4 17.17V4h16v12z' />\n </svg>\n);\n\n/**\n * The chevron of the drop-down toggle. Decorative: the toggle carries the accessible name.\n */\nexport const ChevronIcon = () => (\n <svg className='notes-icon' viewBox='0 0 24 24' width='1em' height='1em' aria-hidden='true' focusable='false'>\n <path fill='currentColor' d='M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z' />\n </svg>\n);\n\n/**\n * The close icon of a chosen slice's remove button. Decorative: the button carries the accessible name.\n */\nexport const CloseIcon = () => (\n <svg className='notes-icon' viewBox='0 0 24 24' width='1em' height='1em' aria-hidden='true' focusable='false'>\n <path fill='currentColor' d='M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z' />\n </svg>\n);\n"],"names":["FeedbackIcon","_jsx","svg","className","viewBox","width","height","aria-hidden","focusable","path","fill","d","ChevronIcon","CloseIcon"],"mappings":";;;;AAAA;AACA;AAEA;;AAEC,IACM,MAAMA,YAAAA,GAAe,kBACxBC,cAAA,CAACC,KAAAA,EAAAA;QAAIC,SAAAA,EAAU,YAAA;QAAaC,OAAAA,EAAQ,WAAA;QAAYC,KAAAA,EAAM,KAAA;QAAMC,MAAAA,EAAO,KAAA;QAAMC,aAAAA,EAAY,MAAA;QAAOC,SAAAA,EAAU,OAAA;AAClG,QAAA,QAAA,gBAAAP,cAAA,CAACQ,MAAAA,EAAAA;YAAKC,IAAAA,EAAK,cAAA;YAAeC,CAAAA,EAAE;;AAElC,KAAA;AAEF;;AAEC,IACM,MAAMC,WAAAA,GAAc,kBACvBX,cAAA,CAACC,KAAAA,EAAAA;QAAIC,SAAAA,EAAU,YAAA;QAAaC,OAAAA,EAAQ,WAAA;QAAYC,KAAAA,EAAM,KAAA;QAAMC,MAAAA,EAAO,KAAA;QAAMC,aAAAA,EAAY,MAAA;QAAOC,SAAAA,EAAU,OAAA;AAClG,QAAA,QAAA,gBAAAP,cAAA,CAACQ,MAAAA,EAAAA;YAAKC,IAAAA,EAAK,cAAA;YAAeC,CAAAA,EAAE;;AAElC,KAAA;AAEF;;AAEC,IACM,MAAME,SAAAA,GAAY,kBACrBZ,cAAA,CAACC,KAAAA,EAAAA;QAAIC,SAAAA,EAAU,YAAA;QAAaC,OAAAA,EAAQ,WAAA;QAAYC,KAAAA,EAAM,KAAA;QAAMC,MAAAA,EAAO,KAAA;QAAMC,aAAAA,EAAY,MAAA;QAAOC,SAAAA,EAAU,OAAA;AAClG,QAAA,QAAA,gBAAAP,cAAA,CAACQ,MAAAA,EAAAA;YAAKC,IAAAA,EAAK,cAAA;YAAeC,CAAAA,EAAE;;AAElC,KAAA;;;;"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export interface NotesLabels {
|
|
2
|
+
common: {
|
|
3
|
+
cancel: string;
|
|
4
|
+
close: string;
|
|
5
|
+
locationSeparator: string;
|
|
6
|
+
unknownLocation: string;
|
|
7
|
+
aboutHeading: string;
|
|
8
|
+
};
|
|
9
|
+
button: {
|
|
10
|
+
giveFeedback: string;
|
|
11
|
+
moreOptions: string;
|
|
12
|
+
aboutSlices: string;
|
|
13
|
+
aboutScreen: string;
|
|
14
|
+
pointAtSomething: string;
|
|
15
|
+
myFeedback: string;
|
|
16
|
+
};
|
|
17
|
+
context: {
|
|
18
|
+
onScreen: string;
|
|
19
|
+
atLocation: string;
|
|
20
|
+
inDialog: string;
|
|
21
|
+
screenOnly: string;
|
|
22
|
+
};
|
|
23
|
+
kinds: {
|
|
24
|
+
title: string;
|
|
25
|
+
problem: string;
|
|
26
|
+
suggestion: string;
|
|
27
|
+
question: string;
|
|
28
|
+
praise: string;
|
|
29
|
+
};
|
|
30
|
+
feedback: {
|
|
31
|
+
contextTitle: string;
|
|
32
|
+
screenTitle: string;
|
|
33
|
+
send: string;
|
|
34
|
+
text: string;
|
|
35
|
+
sent: string;
|
|
36
|
+
};
|
|
37
|
+
slices: {
|
|
38
|
+
title: string;
|
|
39
|
+
active: string;
|
|
40
|
+
search: string;
|
|
41
|
+
searchPlaceholder: string;
|
|
42
|
+
results: string;
|
|
43
|
+
noMatches: string;
|
|
44
|
+
noneActive: string;
|
|
45
|
+
chosen: string;
|
|
46
|
+
remove: string;
|
|
47
|
+
};
|
|
48
|
+
component: {
|
|
49
|
+
title: string;
|
|
50
|
+
about: string;
|
|
51
|
+
describe: string;
|
|
52
|
+
change: string;
|
|
53
|
+
mode: string;
|
|
54
|
+
nothingToChange: string;
|
|
55
|
+
previewNotice: string;
|
|
56
|
+
sendChanges: string;
|
|
57
|
+
noChanges: string;
|
|
58
|
+
failed: string;
|
|
59
|
+
};
|
|
60
|
+
picker: {
|
|
61
|
+
started: string;
|
|
62
|
+
};
|
|
63
|
+
myFeedback: {
|
|
64
|
+
title: string;
|
|
65
|
+
description: string;
|
|
66
|
+
empty: string;
|
|
67
|
+
withdraw: string;
|
|
68
|
+
withdrawNote: string;
|
|
69
|
+
suggestionsOnly: string;
|
|
70
|
+
targets: {
|
|
71
|
+
context: string;
|
|
72
|
+
slices: string;
|
|
73
|
+
screen: string;
|
|
74
|
+
component: string;
|
|
75
|
+
};
|
|
76
|
+
statuses: {
|
|
77
|
+
given: string;
|
|
78
|
+
acknowledged: string;
|
|
79
|
+
addressed: string;
|
|
80
|
+
declined: string;
|
|
81
|
+
withdrawn: string;
|
|
82
|
+
};
|
|
83
|
+
propertyChanges: string;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export type DeepPartial<T> = {
|
|
87
|
+
[TKey in keyof T]?: T[TKey] extends object ? DeepPartial<T[TKey]> : T[TKey];
|
|
88
|
+
};
|
|
89
|
+
export type NotesL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AI;KACxB,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;CAC9E,CAAC;AAMF,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultNotesLabels.d.ts","sourceRoot":"","sources":["../../../Labels/defaultNotesLabels.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAK/C,eAAO,MAAM,kBAAkB,EAAE,WAoFhC,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/**
|
|
6
|
+
* The English labels of the Notes components.
|
|
7
|
+
*/ const defaultNotesLabels = {
|
|
8
|
+
common: {
|
|
9
|
+
cancel: 'Cancel',
|
|
10
|
+
close: 'Close',
|
|
11
|
+
locationSeparator: ' › ',
|
|
12
|
+
unknownLocation: 'Unknown location',
|
|
13
|
+
aboutHeading: 'About'
|
|
14
|
+
},
|
|
15
|
+
button: {
|
|
16
|
+
giveFeedback: 'Give feedback',
|
|
17
|
+
moreOptions: 'More ways to give feedback',
|
|
18
|
+
aboutSlices: 'About specific slices…',
|
|
19
|
+
aboutScreen: 'About this screen…',
|
|
20
|
+
pointAtSomething: 'Point at something…',
|
|
21
|
+
myFeedback: 'My feedback'
|
|
22
|
+
},
|
|
23
|
+
context: {
|
|
24
|
+
onScreen: '{location}, on screen {screen}',
|
|
25
|
+
atLocation: '{location}',
|
|
26
|
+
inDialog: '{location}, in the dialog {dialog}, on screen {screen}',
|
|
27
|
+
screenOnly: 'Screen {screen}'
|
|
28
|
+
},
|
|
29
|
+
kinds: {
|
|
30
|
+
title: 'What kind of feedback is it?',
|
|
31
|
+
problem: 'Problem',
|
|
32
|
+
suggestion: 'Suggestion',
|
|
33
|
+
question: 'Question',
|
|
34
|
+
praise: 'Praise'
|
|
35
|
+
},
|
|
36
|
+
feedback: {
|
|
37
|
+
contextTitle: 'Give feedback on this',
|
|
38
|
+
screenTitle: 'Give feedback on this screen',
|
|
39
|
+
send: 'Send feedback',
|
|
40
|
+
text: 'What do you think?',
|
|
41
|
+
sent: 'Thank you for your feedback'
|
|
42
|
+
},
|
|
43
|
+
slices: {
|
|
44
|
+
title: 'Give feedback on specific slices',
|
|
45
|
+
active: 'On this screen',
|
|
46
|
+
search: 'Search all slices',
|
|
47
|
+
searchPlaceholder: 'Search by module, feature or slice',
|
|
48
|
+
results: 'Matching slices',
|
|
49
|
+
noMatches: 'No slice matches.',
|
|
50
|
+
noneActive: 'No slice is active on this screen.',
|
|
51
|
+
chosen: '{count} chosen',
|
|
52
|
+
remove: 'Remove {slice}'
|
|
53
|
+
},
|
|
54
|
+
component: {
|
|
55
|
+
title: 'Give feedback on a component',
|
|
56
|
+
about: 'About {component}',
|
|
57
|
+
describe: 'Describe it',
|
|
58
|
+
change: 'Change it',
|
|
59
|
+
mode: 'How to give feedback',
|
|
60
|
+
nothingToChange: 'This component has no properties to change.',
|
|
61
|
+
previewNotice: 'Changes show here as a preview, and go away when you close this dialog.',
|
|
62
|
+
sendChanges: 'Send changes',
|
|
63
|
+
noChanges: 'Change a property to send a suggestion.',
|
|
64
|
+
failed: '{count} changes could not be sent. Try again.'
|
|
65
|
+
},
|
|
66
|
+
picker: {
|
|
67
|
+
started: 'Click a component to give feedback on it. Press Escape to cancel.'
|
|
68
|
+
},
|
|
69
|
+
myFeedback: {
|
|
70
|
+
title: 'My feedback',
|
|
71
|
+
description: 'The feedback you gave and where it stands.',
|
|
72
|
+
empty: 'You have not given any feedback yet.',
|
|
73
|
+
withdraw: 'Withdraw',
|
|
74
|
+
withdrawNote: 'Withdraw the note: {text}',
|
|
75
|
+
suggestionsOnly: 'Suggested changes',
|
|
76
|
+
targets: {
|
|
77
|
+
context: 'What was on screen',
|
|
78
|
+
slices: 'Slices',
|
|
79
|
+
screen: 'Screen',
|
|
80
|
+
component: 'Component {component}'
|
|
81
|
+
},
|
|
82
|
+
statuses: {
|
|
83
|
+
given: 'Given',
|
|
84
|
+
acknowledged: 'Acknowledged',
|
|
85
|
+
addressed: 'Addressed in {version}',
|
|
86
|
+
declined: 'Declined: {reason}',
|
|
87
|
+
withdrawn: 'Withdrawn'
|
|
88
|
+
},
|
|
89
|
+
propertyChanges: '{count} suggested property changes'
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
exports.defaultNotesLabels = defaultNotesLabels;
|
|
94
|
+
//# sourceMappingURL=defaultNotesLabels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultNotesLabels.js","sources":["../../../Labels/defaultNotesLabels.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { NotesLabels } from './NotesLabels.js';\n\n/**\n * The English labels of the Notes components.\n */\nexport const defaultNotesLabels: NotesLabels = {\n common: {\n cancel: 'Cancel',\n close: 'Close',\n locationSeparator: ' › ',\n unknownLocation: 'Unknown location',\n aboutHeading: 'About'\n },\n button: {\n giveFeedback: 'Give feedback',\n moreOptions: 'More ways to give feedback',\n aboutSlices: 'About specific slices…',\n aboutScreen: 'About this screen…',\n pointAtSomething: 'Point at something…',\n myFeedback: 'My feedback'\n },\n context: {\n onScreen: '{location}, on screen {screen}',\n atLocation: '{location}',\n inDialog: '{location}, in the dialog {dialog}, on screen {screen}',\n screenOnly: 'Screen {screen}'\n },\n kinds: {\n title: 'What kind of feedback is it?',\n problem: 'Problem',\n suggestion: 'Suggestion',\n question: 'Question',\n praise: 'Praise'\n },\n feedback: {\n contextTitle: 'Give feedback on this',\n screenTitle: 'Give feedback on this screen',\n send: 'Send feedback',\n text: 'What do you think?',\n sent: 'Thank you for your feedback'\n },\n slices: {\n title: 'Give feedback on specific slices',\n active: 'On this screen',\n search: 'Search all slices',\n searchPlaceholder: 'Search by module, feature or slice',\n results: 'Matching slices',\n noMatches: 'No slice matches.',\n noneActive: 'No slice is active on this screen.',\n chosen: '{count} chosen',\n remove: 'Remove {slice}'\n },\n component: {\n title: 'Give feedback on a component',\n about: 'About {component}',\n describe: 'Describe it',\n change: 'Change it',\n mode: 'How to give feedback',\n nothingToChange: 'This component has no properties to change.',\n previewNotice: 'Changes show here as a preview, and go away when you close this dialog.',\n sendChanges: 'Send changes',\n noChanges: 'Change a property to send a suggestion.',\n failed: '{count} changes could not be sent. Try again.'\n },\n picker: {\n started: 'Click a component to give feedback on it. Press Escape to cancel.'\n },\n myFeedback: {\n title: 'My feedback',\n description: 'The feedback you gave and where it stands.',\n empty: 'You have not given any feedback yet.',\n withdraw: 'Withdraw',\n withdrawNote: 'Withdraw the note: {text}',\n suggestionsOnly: 'Suggested changes',\n targets: {\n context: 'What was on screen',\n slices: 'Slices',\n screen: 'Screen',\n component: 'Component {component}'\n },\n statuses: {\n given: 'Given',\n acknowledged: 'Acknowledged',\n addressed: 'Addressed in {version}',\n declined: 'Declined: {reason}',\n withdrawn: 'Withdrawn'\n },\n propertyChanges: '{count} suggested property changes'\n }\n};\n"],"names":["defaultNotesLabels","common","cancel","close","locationSeparator","unknownLocation","aboutHeading","button","giveFeedback","moreOptions","aboutSlices","aboutScreen","pointAtSomething","myFeedback","context","onScreen","atLocation","inDialog","screenOnly","kinds","title","problem","suggestion","question","praise","feedback","contextTitle","screenTitle","send","text","sent","slices","active","search","searchPlaceholder","results","noMatches","noneActive","chosen","remove","component","about","describe","change","mode","nothingToChange","previewNotice","sendChanges","noChanges","failed","picker","started","description","empty","withdraw","withdrawNote","suggestionsOnly","targets","screen","statuses","given","acknowledged","addressed","declined","withdrawn","propertyChanges"],"mappings":";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,IAAAA,EAAM,sBAAA;QACNC,eAAAA,EAAiB,6CAAA;QACjBC,aAAAA,EAAe,yEAAA;QACfC,WAAAA,EAAa,cAAA;QACbC,SAAAA,EAAW,yCAAA;QACXC,MAAAA,EAAQ;AACZ,KAAA;IACAC,MAAAA,EAAQ;QACJC,OAAAA,EAAS;AACb,KAAA;IACAtC,UAAAA,EAAY;QACRO,KAAAA,EAAO,aAAA;QACPgC,WAAAA,EAAa,4CAAA;QACbC,KAAAA,EAAO,sCAAA;QACPC,QAAAA,EAAU,UAAA;QACVC,YAAAA,EAAc,2BAAA;QACdC,eAAAA,EAAiB,mBAAA;QACjBC,OAAAA,EAAS;YACL3C,OAAAA,EAAS,oBAAA;YACTiB,MAAAA,EAAQ,QAAA;YACR2B,MAAAA,EAAQ,QAAA;YACRlB,SAAAA,EAAW;AACf,SAAA;QACAmB,QAAAA,EAAU;YACNC,KAAAA,EAAO,OAAA;YACPC,YAAAA,EAAc,cAAA;YACdC,SAAAA,EAAW,wBAAA;YACXC,QAAAA,EAAU,oBAAA;YACVC,SAAAA,EAAW;AACf,SAAA;QACAC,eAAAA,EAAiB;AACrB;AACJ;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../Labels/format.ts"],"names":[],"mappings":"AASA,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAGxF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/**
|
|
6
|
+
* Fills the placeholders of a label, such as `{count}`, with values. A placeholder without a value is left as it is.
|
|
7
|
+
* @param template The label.
|
|
8
|
+
* @param values The values by placeholder name.
|
|
9
|
+
* @returns The label with its placeholders filled in.
|
|
10
|
+
*/ function format(template, values) {
|
|
11
|
+
return template.replace(/\{(\w+)\}/g, (placeholder, name)=>Object.hasOwn(values, name) ? String(values[name]) : placeholder);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exports.format = format;
|
|
15
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sources":["../../../Labels/format.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * Fills the placeholders of a label, such as `{count}`, with values. A placeholder without a value is left as it is.\n * @param template The label.\n * @param values The values by placeholder name.\n * @returns The label with its placeholders filled in.\n */\nexport function format(template: string, values: Record<string, string | number>): string {\n return template.replace(/\\{(\\w+)\\}/g, (placeholder, name: string) =>\n Object.hasOwn(values, name) ? String(values[name]) : placeholder);\n}\n"],"names":["format","template","values","replace","placeholder","name","Object","hasOwn","String"],"mappings":";;AAAA;AACA;AAEA;;;;;AAKC,IACM,SAASA,MAAAA,CAAOC,QAAgB,EAAEC,MAAuC,EAAA;AAC5E,IAAA,OAAOD,SAASE,OAAO,CAAC,YAAA,EAAc,CAACC,aAAaC,IAAAA,GAChDC,MAAAA,CAAOC,MAAM,CAACL,QAAQG,IAAAA,CAAAA,GAAQG,MAAAA,CAAON,MAAM,CAACG,KAAK,CAAA,GAAID,WAAAA,CAAAA;AAC7D;;"}
|