@rightkit/social-ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/README.md +40 -2
- package/dist/appName.d.ts +2 -0
- package/dist/appName.js +8 -0
- package/dist/components/ScopeSelect.d.ts +7 -0
- package/dist/components/ScopeSelect.js +6 -0
- package/dist/components/Shared.d.ts +34 -0
- package/dist/components/Shared.js +55 -0
- package/dist/data/derive.d.ts +21 -0
- package/dist/data/derive.js +47 -0
- package/dist/data/draftRules.d.ts +10 -0
- package/dist/data/draftRules.js +20 -0
- package/dist/data/engine/engineDataSource.d.ts +194 -0
- package/dist/data/engine/engineDataSource.js +836 -0
- package/dist/data/engine/errors.d.ts +13 -0
- package/dist/data/engine/errors.js +21 -0
- package/dist/data/engine/mapping.d.ts +172 -0
- package/dist/data/engine/mapping.js +1487 -0
- package/dist/data/engine/protocol.d.ts +910 -0
- package/dist/data/engine/protocol.js +67 -0
- package/dist/data/index.d.ts +18 -0
- package/dist/data/index.js +23 -0
- package/dist/data/mock/devSource.d.ts +7 -0
- package/dist/data/mock/devSource.js +10 -0
- package/dist/data/mock/fixtures-analytics.d.ts +7 -0
- package/dist/data/mock/fixtures-analytics.js +123 -0
- package/dist/data/mock/fixtures-briefs.d.ts +4 -0
- package/dist/data/mock/fixtures-briefs.js +230 -0
- package/dist/data/mock/fixtures-content.d.ts +4 -0
- package/dist/data/mock/fixtures-content.js +89 -0
- package/dist/data/mock/fixtures-digests.d.ts +3 -0
- package/dist/data/mock/fixtures-digests.js +40 -0
- package/dist/data/mock/fixtures-drafts.d.ts +2 -0
- package/dist/data/mock/fixtures-drafts.js +74 -0
- package/dist/data/mock/fixtures-gate.d.ts +3 -0
- package/dist/data/mock/fixtures-gate.js +49 -0
- package/dist/data/mock/fixtures-hooks.d.ts +2 -0
- package/dist/data/mock/fixtures-hooks.js +103 -0
- package/dist/data/mock/fixtures-inbox.d.ts +11 -0
- package/dist/data/mock/fixtures-inbox.js +213 -0
- package/dist/data/mock/fixtures-links.d.ts +5 -0
- package/dist/data/mock/fixtures-links.js +89 -0
- package/dist/data/mock/fixtures-memory.d.ts +3 -0
- package/dist/data/mock/fixtures-memory.js +148 -0
- package/dist/data/mock/fixtures-ops.d.ts +15 -0
- package/dist/data/mock/fixtures-ops.js +403 -0
- package/dist/data/mock/fixtures-optimise.d.ts +18 -0
- package/dist/data/mock/fixtures-optimise.js +221 -0
- package/dist/data/mock/fixtures-pacing.d.ts +5 -0
- package/dist/data/mock/fixtures-pacing.js +285 -0
- package/dist/data/mock/fixtures-publish.d.ts +2 -0
- package/dist/data/mock/fixtures-publish.js +129 -0
- package/dist/data/mock/fixtures-store.d.ts +10 -0
- package/dist/data/mock/fixtures-store.js +13 -0
- package/dist/data/mock/fixtures-variants.d.ts +5 -0
- package/dist/data/mock/fixtures-variants.js +138 -0
- package/dist/data/mock/fixtures.d.ts +6 -0
- package/dist/data/mock/fixtures.js +420 -0
- package/dist/data/mock/mockDataSource.d.ts +98 -0
- package/dist/data/mock/mockDataSource.js +903 -0
- package/dist/data/money.d.ts +14 -0
- package/dist/data/money.js +36 -0
- package/dist/data/platforms.d.ts +12 -0
- package/dist/data/platforms.js +26 -0
- package/dist/data/source.d.ts +196 -0
- package/dist/data/source.js +1 -0
- package/dist/data/time.d.ts +23 -0
- package/dist/data/time.js +86 -0
- package/dist/data/types.d.ts +1092 -0
- package/dist/data/types.js +3 -0
- package/dist/env.d.ts +59 -0
- package/dist/hooks/useAsync.d.ts +19 -0
- package/dist/hooks/useAsync.js +25 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.js +58 -0
- package/dist/lib/host.d.ts +21 -0
- package/dist/lib/host.js +32 -0
- package/dist/lib/shell.d.ts +156 -0
- package/dist/lib/shell.js +16 -0
- package/dist/screens/AccountsScreen.d.ts +8 -0
- package/dist/screens/AccountsScreen.js +100 -0
- package/dist/screens/AnalyticsScreen.d.ts +7 -0
- package/dist/screens/AnalyticsScreen.js +64 -0
- package/dist/screens/ApprovalsScreen.d.ts +10 -0
- package/dist/screens/ApprovalsScreen.js +144 -0
- package/dist/screens/BriefsScreen.d.ts +7 -0
- package/dist/screens/BriefsScreen.js +83 -0
- package/dist/screens/CalendarScreen.d.ts +10 -0
- package/dist/screens/CalendarScreen.js +143 -0
- package/dist/screens/CampaignsScreen.d.ts +7 -0
- package/dist/screens/CampaignsScreen.js +52 -0
- package/dist/screens/ChannelMemoryScreen.d.ts +7 -0
- package/dist/screens/ChannelMemoryScreen.js +109 -0
- package/dist/screens/ContentScreen.d.ts +7 -0
- package/dist/screens/ContentScreen.js +64 -0
- package/dist/screens/DigestsScreen.d.ts +7 -0
- package/dist/screens/DigestsScreen.js +53 -0
- package/dist/screens/DraftsScreen.d.ts +10 -0
- package/dist/screens/DraftsScreen.js +108 -0
- package/dist/screens/FailuresScreen.d.ts +8 -0
- package/dist/screens/FailuresScreen.js +111 -0
- package/dist/screens/HookTestsScreen.d.ts +7 -0
- package/dist/screens/HookTestsScreen.js +54 -0
- package/dist/screens/InboxScreen.d.ts +12 -0
- package/dist/screens/InboxScreen.js +76 -0
- package/dist/screens/LinksScreen.d.ts +7 -0
- package/dist/screens/LinksScreen.js +52 -0
- package/dist/screens/PacingScreen.d.ts +7 -0
- package/dist/screens/PacingScreen.js +88 -0
- package/dist/screens/PublishJobsScreen.d.ts +7 -0
- package/dist/screens/PublishJobsScreen.js +66 -0
- package/dist/screens/SuggestionsScreen.d.ts +8 -0
- package/dist/screens/SuggestionsScreen.js +94 -0
- package/dist/screens/TextGateScreen.d.ts +7 -0
- package/dist/screens/TextGateScreen.js +111 -0
- package/dist/screens/ThreadsScreen.d.ts +8 -0
- package/dist/screens/ThreadsScreen.js +113 -0
- package/dist/screens/TypedBriefsScreen.d.ts +7 -0
- package/dist/screens/TypedBriefsScreen.js +75 -0
- package/dist/screens/labels.d.ts +121 -0
- package/dist/screens/labels.js +272 -0
- package/package.json +56 -3
package/CHANGELOG.md
ADDED
package/LICENSE-APACHE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/LICENSE-MIT
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Adrian D'souza
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @rightkit/social-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Social media management UI: accounts, drafts, approvals and analytics screens with their data layer.
|
|
4
|
+
|
|
5
|
+
| Item | Value |
|
|
6
|
+
|---|---|
|
|
7
|
+
| Where it runs | App webview UI (React) |
|
|
8
|
+
| Version | 0.1.0 |
|
|
9
|
+
| License | MIT OR Apache-2.0 |
|
|
10
|
+
|
|
11
|
+
## Entry points
|
|
12
|
+
|
|
13
|
+
| Import | Contents |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `@rightkit/social-ui` | Every module whose exported names do not collide (generated barrel). |
|
|
16
|
+
| `@rightkit/social-ui/<path>` | Any module under `src/` by path without extension, e.g. `@rightkit/social-ui/appName`. |
|
|
17
|
+
| `@rightkit/social-ui/<path>.css` | Stylesheets shipped next to their components. |
|
|
18
|
+
|
|
19
|
+
## Peer dependencies
|
|
20
|
+
|
|
21
|
+
`react`
|
|
22
|
+
|
|
23
|
+
## Product name
|
|
24
|
+
|
|
25
|
+
User-facing copy reads the product name from `hostAppName()` (default `"App"`). Call
|
|
26
|
+
`setHostAppName("Your App")` (exported from the root and from `appName`) once at startup, before
|
|
27
|
+
rendering.
|
|
28
|
+
|
|
29
|
+
## Host contract
|
|
30
|
+
|
|
31
|
+
Hosts bundle this package with Vite (the build keeps extensionless relative imports and asset imports
|
|
32
|
+
such as `?raw`). Tailwind hosts add `node_modules/@rightkit/social-ui/dist/**/*.js` to their content globs.
|
|
33
|
+
|
|
34
|
+
## Testing
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
pnpm --dir packages/social-ui test
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Modules left out of the root barrel because an export name collides with an earlier module
|
|
41
|
+
(import them by subpath): `data/index.ts`, `data/source.ts`
|
package/dist/appName.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OperatorScope } from "../data/index.js";
|
|
2
|
+
/** The channel the suggestions and spend screens read. A native select, labelled, in the focus order. */
|
|
3
|
+
export declare function ScopeSelect({ scopes, value, onChange, }: {
|
|
4
|
+
scopes: readonly OperatorScope[];
|
|
5
|
+
value: string;
|
|
6
|
+
onChange: (scopeId: string) => void;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Field } from "@rightkit/react-shell/react";
|
|
3
|
+
/** The channel the suggestions and spend screens read. A native select, labelled, in the focus order. */
|
|
4
|
+
export function ScopeSelect({ scopes, value, onChange, }) {
|
|
5
|
+
return (_jsx(Field, { label: "Channel", children: ({ id, "aria-describedby": describedBy }) => (_jsx("select", { id: id, "aria-describedby": describedBy, className: "op-select", value: value, onChange: (e) => onChange(e.target.value), children: scopes.map((scope) => (_jsx("option", { value: scope.id, children: scope.label }, scope.id))) })) }));
|
|
6
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Account, AccountOrdinal, PublishJob, PublishProgress } from "../data/index.js";
|
|
2
|
+
/** Shown on every screen while MockDataSource is active. Folds to nothing in a release build (Vite constant-folds the guard). */
|
|
3
|
+
export declare function MockBanner(): import("react").JSX.Element | null;
|
|
4
|
+
/**
|
|
5
|
+
* Account identity: stable colour band, a text label, platform and handle. The colour is a
|
|
6
|
+
* decoration only; the words carry the meaning.
|
|
7
|
+
*/
|
|
8
|
+
export declare function AccountChip({ account, ordinal, detail, }: {
|
|
9
|
+
account: Account;
|
|
10
|
+
ordinal?: AccountOrdinal;
|
|
11
|
+
detail?: boolean;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
/** State, approval and flag labels for one job. Every flag is text, never colour alone. */
|
|
14
|
+
export declare function JobBadges({ job, compact }: {
|
|
15
|
+
job: PublishJob;
|
|
16
|
+
compact?: boolean;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* The daemon's publish state for one job. A waiting job shows when it resumes: a quota cooldown for
|
|
20
|
+
* rate_limited, otherwise a retry wait. The platform link is shown as text with a Copy link button.
|
|
21
|
+
* The link is never opened from here.
|
|
22
|
+
*/
|
|
23
|
+
/** A platform permalink as selectable text with a Copy link button. It is never an anchor, so it never opens. */
|
|
24
|
+
export declare function PermalinkCopy({ url }: {
|
|
25
|
+
url: string;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
export declare function PublishProgressView({ progress, timeZone }: {
|
|
28
|
+
progress: PublishProgress;
|
|
29
|
+
timeZone: string;
|
|
30
|
+
}): import("react").JSX.Element;
|
|
31
|
+
export declare function LoadError({ message, onRetry }: {
|
|
32
|
+
message: string;
|
|
33
|
+
onRetry: () => void;
|
|
34
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Badge, Button, Notice } from "@rightkit/react-shell/react";
|
|
4
|
+
import { instantLabel, timeInZone } from "../data/index.js";
|
|
5
|
+
import { shell } from "../lib/shell.js";
|
|
6
|
+
import { PLATFORM_LABEL, PUBLISH_STATE_LABEL, STATE_LABEL, approvalText } from "../screens/labels.js";
|
|
7
|
+
/** Shown on every screen while MockDataSource is active. Folds to nothing in a release build (Vite constant-folds the guard). */
|
|
8
|
+
export function MockBanner() {
|
|
9
|
+
if (!(import.meta.env?.DEV || (typeof __RIGHTKIT_MOCK__ === "boolean" && __RIGHTKIT_MOCK__)))
|
|
10
|
+
return null;
|
|
11
|
+
return (_jsxs("p", { role: "status", className: "op-banner", children: [_jsx("strong", { children: "Mock data." }), " Invented channels held in memory. Nothing here is live and nothing publishes."] }));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Account identity: stable colour band, a text label, platform and handle. The colour is a
|
|
15
|
+
* decoration only; the words carry the meaning.
|
|
16
|
+
*/
|
|
17
|
+
export function AccountChip({ account, ordinal, detail = false, }) {
|
|
18
|
+
return (_jsxs("span", { className: `op-chip op-band-${account.band}`, children: [_jsxs("span", { className: "op-chip__name", children: [ordinal ? ordinal.label : "Account", ": ", account.displayName] }), _jsxs("span", { className: "op-chip__meta", children: [PLATFORM_LABEL[account.platform], " ", _jsx("span", { className: "op-chip__handle", children: account.handle }), detail ? ` · id ending ${account.idSuffix}` : null] })] }));
|
|
19
|
+
}
|
|
20
|
+
/** State, approval and flag labels for one job. Every flag is text, never colour alone. */
|
|
21
|
+
export function JobBadges({ job, compact = false }) {
|
|
22
|
+
const state = STATE_LABEL[job.state];
|
|
23
|
+
const approval = approvalText(job.approval);
|
|
24
|
+
return (_jsxs("span", { className: "op-badges", children: [_jsx(Badge, { tone: state.tone, children: state.text }), compact ? null : _jsx(Badge, { tone: approval.tone, children: approval.text }), job.lateness ? (_jsxs(Badge, { tone: "warn", children: ["Late: media not ready by ", timeInZone(job.lateness.mediaNotReadyBy, job.timeZone)] })) : null, job.conflict ? (_jsxs(Badge, { tone: "bad", children: ["Conflict: ", job.conflict.minimumSpacingMinutes, " min spacing"] })) : null, job.dst.kind === "ambiguous_fires_once" ? _jsx(Badge, { tone: "accent", children: "DST: fires once" }) : null, job.dst.kind === "nonexistent_moved" ? _jsx(Badge, { tone: "accent", children: "DST: moved by account rule" }) : null] }));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The daemon's publish state for one job. A waiting job shows when it resumes: a quota cooldown for
|
|
28
|
+
* rate_limited, otherwise a retry wait. The platform link is shown as text with a Copy link button.
|
|
29
|
+
* The link is never opened from here.
|
|
30
|
+
*/
|
|
31
|
+
/** A platform permalink as selectable text with a Copy link button. It is never an anchor, so it never opens. */
|
|
32
|
+
export function PermalinkCopy({ url }) {
|
|
33
|
+
const [copy, setCopy] = useState("idle");
|
|
34
|
+
async function copyLink() {
|
|
35
|
+
try {
|
|
36
|
+
await shell.clipboard.write({ text: url });
|
|
37
|
+
setCopy("copied");
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
setCopy("failed");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return (_jsxs("div", { className: "op-publish__link", children: [_jsxs("p", { children: ["Platform link: ", _jsx("span", { className: "op-mono", children: url })] }), _jsx(Button, { size: "sm", variant: "secondary", onClick: copyLink, "aria-label": `Copy link to ${url}`, children: "Copy link" }), _jsx("span", { role: "status", children: copy === "copied" ? "Link copied." : copy === "failed" ? "Copy failed. Select the link text and copy it." : "" })] }));
|
|
44
|
+
}
|
|
45
|
+
export function PublishProgressView({ progress, timeZone }) {
|
|
46
|
+
const label = PUBLISH_STATE_LABEL[progress.state];
|
|
47
|
+
const link = progress.permalink;
|
|
48
|
+
const waitKind = progress.errorCode === "rate_limited" ? "Quota cooldown" : "Retry wait";
|
|
49
|
+
return (_jsxs("section", { className: "op-publish", "aria-label": "Publish status", children: [_jsxs("p", { children: ["Daemon publish: ", _jsx(Badge, { tone: label.tone, children: label.text })] }), progress.state === "waiting" ? (_jsx("p", { children: progress.resumeAtUtc !== null
|
|
50
|
+
? `${waitKind}. Resumes ${instantLabel(progress.resumeAtUtc, timeZone)}.`
|
|
51
|
+
: `${waitKind}. The resume time is not reported.` })) : null, link !== null ? _jsx(PermalinkCopy, { url: link }) : null] }));
|
|
52
|
+
}
|
|
53
|
+
export function LoadError({ message, onRetry }) {
|
|
54
|
+
return (_jsx(Notice, { tone: "bad", action: _jsx(Button, { size: "sm", variant: "secondary", onClick: onRetry, children: "Retry" }), children: message }));
|
|
55
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Account, PublishJob } from "./types.js";
|
|
2
|
+
export interface AccountOrdinal {
|
|
3
|
+
/** "Account A", "Account B". Unique within one venture and platform. */
|
|
4
|
+
label: string;
|
|
5
|
+
letter: string;
|
|
6
|
+
index: number;
|
|
7
|
+
of: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Two accounts on one platform inside one venture get letters A, B in list order. The label is
|
|
11
|
+
* always shown with the handle, so the letter is never the only distinguisher.
|
|
12
|
+
*/
|
|
13
|
+
export declare function accountOrdinals(accounts: readonly Account[]): Map<string, AccountOrdinal>;
|
|
14
|
+
/** Short form of a digest: algorithm prefix removed, first eight characters kept. */
|
|
15
|
+
export declare function shortHash(hash: string): string;
|
|
16
|
+
/** Character count in code points, which is how the preview counts what a reader sees. */
|
|
17
|
+
export declare function charCount(text: string): number;
|
|
18
|
+
export declare function awaitingDecision(job: PublishJob): boolean;
|
|
19
|
+
export declare function isApproved(job: PublishJob): boolean;
|
|
20
|
+
export declare function mediaReady(job: PublishJob): boolean;
|
|
21
|
+
export declare function jobsByAccount(jobs: readonly PublishJob[]): Map<string, PublishJob[]>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Two accounts on one platform inside one venture get letters A, B in list order. The label is
|
|
3
|
+
* always shown with the handle, so the letter is never the only distinguisher.
|
|
4
|
+
*/
|
|
5
|
+
export function accountOrdinals(accounts) {
|
|
6
|
+
const groups = new Map();
|
|
7
|
+
for (const account of accounts) {
|
|
8
|
+
const key = `${account.venture.id}|${account.platform}`;
|
|
9
|
+
const group = groups.get(key) ?? [];
|
|
10
|
+
group.push(account);
|
|
11
|
+
groups.set(key, group);
|
|
12
|
+
}
|
|
13
|
+
const out = new Map();
|
|
14
|
+
for (const group of groups.values()) {
|
|
15
|
+
group.forEach((account, index) => {
|
|
16
|
+
const letter = String.fromCharCode(65 + index);
|
|
17
|
+
out.set(account.id, { label: `Account ${letter}`, letter, index, of: group.length });
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return out;
|
|
21
|
+
}
|
|
22
|
+
/** Short form of a digest: algorithm prefix removed, first eight characters kept. */
|
|
23
|
+
export function shortHash(hash) {
|
|
24
|
+
return hash.replace(/^[a-z0-9]+:/, "").slice(0, 8);
|
|
25
|
+
}
|
|
26
|
+
/** Character count in code points, which is how the preview counts what a reader sees. */
|
|
27
|
+
export function charCount(text) {
|
|
28
|
+
return [...text].length;
|
|
29
|
+
}
|
|
30
|
+
export function awaitingDecision(job) {
|
|
31
|
+
return job.approval.status === "pending" || job.approval.status === "invalidated";
|
|
32
|
+
}
|
|
33
|
+
export function isApproved(job) {
|
|
34
|
+
return job.approval.status === "approved";
|
|
35
|
+
}
|
|
36
|
+
export function mediaReady(job) {
|
|
37
|
+
return job.mediaItems.length > 0 && job.mediaItems.every((m) => m.status === "ready");
|
|
38
|
+
}
|
|
39
|
+
export function jobsByAccount(jobs) {
|
|
40
|
+
const map = new Map();
|
|
41
|
+
for (const job of jobs) {
|
|
42
|
+
const list = map.get(job.accountId) ?? [];
|
|
43
|
+
list.push(job);
|
|
44
|
+
map.set(job.accountId, list);
|
|
45
|
+
}
|
|
46
|
+
return map;
|
|
47
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The first sentence, as the engine reads it: text up to and including the first ".", "!" or "?",
|
|
3
|
+
* or up to the first line break, whichever comes first. The whole text when neither occurs.
|
|
4
|
+
*/
|
|
5
|
+
export declare function firstSentence(body: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* True when the first sentence contains one of the phrases, compared case-insensitively. Blank
|
|
8
|
+
* phrases never match, so an empty phrase list matches nothing.
|
|
9
|
+
*/
|
|
10
|
+
export declare function disclosureFound(body: string, phrases: readonly string[]): boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Draft rules the desktop can show before the engine answers. The engine's approval gate is the
|
|
2
|
+
// authority; these helpers only let a screen say what it already sees in the text.
|
|
3
|
+
/**
|
|
4
|
+
* The first sentence, as the engine reads it: text up to and including the first ".", "!" or "?",
|
|
5
|
+
* or up to the first line break, whichever comes first. The whole text when neither occurs.
|
|
6
|
+
*/
|
|
7
|
+
export function firstSentence(body) {
|
|
8
|
+
return /^[^\n.!?]*[.!?]?/.exec(body)?.[0] ?? "";
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* True when the first sentence contains one of the phrases, compared case-insensitively. Blank
|
|
12
|
+
* phrases never match, so an empty phrase list matches nothing.
|
|
13
|
+
*/
|
|
14
|
+
export function disclosureFound(body, phrases) {
|
|
15
|
+
const sentence = firstSentence(body).toLowerCase();
|
|
16
|
+
return phrases.some((phrase) => {
|
|
17
|
+
const needle = phrase.trim().toLowerCase();
|
|
18
|
+
return needle !== "" && sentence.includes(needle);
|
|
19
|
+
});
|
|
20
|
+
}
|