@gogitcms/editor 0.23.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/app/index.html +38 -0
- package/app/src/App.tsx +2665 -0
- package/app/src/apollo.ts +119 -0
- package/app/src/auth.ts +248 -0
- package/app/src/config.ts +88 -0
- package/app/src/main.tsx +18 -0
- package/app/src/media.ts +151 -0
- package/app/src/navigation.tsx +321 -0
- package/app/src/plugins.ts +11 -0
- package/app/src/previewHost.tsx +263 -0
- package/app/src/previewToken.ts +68 -0
- package/app/src/queries.ts +591 -0
- package/app/src/virtual-cms-plugins.d.ts +6 -0
- package/app/vendor/analytics/src/__tests__/config.test.ts +91 -0
- package/app/vendor/analytics/src/config.ts +94 -0
- package/app/vendor/analytics/src/events.ts +56 -0
- package/app/vendor/analytics/src/index.ts +23 -0
- package/app/vendor/analytics/src/provider.tsx +196 -0
- package/app/vendor/design-system/src/ThemeProvider.tsx +86 -0
- package/app/vendor/design-system/src/__tests__/ApplyChangesModal.test.tsx +148 -0
- package/app/vendor/design-system/src/__tests__/BranchImport.test.tsx +46 -0
- package/app/vendor/design-system/src/__tests__/Button.test.tsx +45 -0
- package/app/vendor/design-system/src/__tests__/ChangeRequestSummary.test.tsx +57 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.changes.test.tsx +611 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.collab.test.tsx +322 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.collabsync.test.tsx +264 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.contentslot.test.tsx +53 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.discriminator.test.tsx +142 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.drafts.test.tsx +271 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.fields.test.tsx +117 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.media.test.tsx +140 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.mixedcollab.test.tsx +63 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.mixedvalues.test.tsx +38 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.pagination.test.tsx +62 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.previewtab.test.tsx +212 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.reorder.test.tsx +45 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.search.test.tsx +135 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.selectvalue.test.tsx +185 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.staged.test.tsx +132 -0
- package/app/vendor/design-system/src/__tests__/ContentBrowser.usermenu.test.tsx +56 -0
- package/app/vendor/design-system/src/__tests__/MediaBrowser.test.tsx +353 -0
- package/app/vendor/design-system/src/__tests__/MediaField.test.tsx +185 -0
- package/app/vendor/design-system/src/__tests__/Notifications.test.tsx +69 -0
- package/app/vendor/design-system/src/__tests__/Onboarding.test.tsx +287 -0
- package/app/vendor/design-system/src/__tests__/cssTokens.test.ts +201 -0
- package/app/vendor/design-system/src/__tests__/fieldComponents.test.ts +43 -0
- package/app/vendor/design-system/src/__tests__/reorder.test.ts +58 -0
- package/app/vendor/design-system/src/components/ApplyChangesModal.tsx +348 -0
- package/app/vendor/design-system/src/components/BranchImport.tsx +157 -0
- package/app/vendor/design-system/src/components/BranchMenu.tsx +192 -0
- package/app/vendor/design-system/src/components/Button.tsx +131 -0
- package/app/vendor/design-system/src/components/ChangeDetail.tsx +472 -0
- package/app/vendor/design-system/src/components/ChangeRequestSummary.tsx +173 -0
- package/app/vendor/design-system/src/components/CollabField.tsx +388 -0
- package/app/vendor/design-system/src/components/ContentBrowser.tsx +5073 -0
- package/app/vendor/design-system/src/components/Icon.tsx +28 -0
- package/app/vendor/design-system/src/components/Icon.web.tsx +31 -0
- package/app/vendor/design-system/src/components/Input.tsx +106 -0
- package/app/vendor/design-system/src/components/MediaBrowser.tsx +766 -0
- package/app/vendor/design-system/src/components/MediaField.tsx +670 -0
- package/app/vendor/design-system/src/components/MediaPreview.tsx +91 -0
- package/app/vendor/design-system/src/components/MediaPreview.web.tsx +169 -0
- package/app/vendor/design-system/src/components/NavRow.tsx +105 -0
- package/app/vendor/design-system/src/components/Notifications.tsx +301 -0
- package/app/vendor/design-system/src/components/Onboarding.tsx +751 -0
- package/app/vendor/design-system/src/components/ProjectMenu.tsx +124 -0
- package/app/vendor/design-system/src/components/Segment.tsx +87 -0
- package/app/vendor/design-system/src/components/Skeleton.tsx +216 -0
- package/app/vendor/design-system/src/components/Spinner.tsx +44 -0
- package/app/vendor/design-system/src/components/Text.tsx +85 -0
- package/app/vendor/design-system/src/components/documentDrafts.ts +213 -0
- package/app/vendor/design-system/src/components/layout.tsx +284 -0
- package/app/vendor/design-system/src/components/primitives.tsx +143 -0
- package/app/vendor/design-system/src/components/reorder.ts +40 -0
- package/app/vendor/design-system/src/fieldComponents.ts +63 -0
- package/app/vendor/design-system/src/icons.ts +102 -0
- package/app/vendor/design-system/src/index.ts +198 -0
- package/app/vendor/design-system/src/media.ts +229 -0
- package/app/vendor/design-system/src/theme.ts +116 -0
- package/app/vendor/design-system/src/web/Button.tsx +110 -0
- package/app/vendor/design-system/src/web/Icon.tsx +52 -0
- package/app/vendor/design-system/src/web/Input.tsx +39 -0
- package/app/vendor/design-system/src/web/index.ts +43 -0
- package/app/vendor/design-system/src/web/primitives.tsx +119 -0
- package/app/vendor/markdown-editor/src/MarkdownEditor.tsx +248 -0
- package/app/vendor/markdown-editor/src/Toolbar.tsx +157 -0
- package/app/vendor/markdown-editor/src/field.tsx +67 -0
- package/app/vendor/markdown-editor/src/flavors/commonmark/index.ts +27 -0
- package/app/vendor/markdown-editor/src/flavors/gfm/index.ts +30 -0
- package/app/vendor/markdown-editor/src/flavors/gfm/parser.ts +73 -0
- package/app/vendor/markdown-editor/src/flavors/gfm/schema.ts +70 -0
- package/app/vendor/markdown-editor/src/flavors/gfm/serializer.ts +82 -0
- package/app/vendor/markdown-editor/src/flavors/gfm/taskList.ts +39 -0
- package/app/vendor/markdown-editor/src/flavors/registry.ts +13 -0
- package/app/vendor/markdown-editor/src/flavors/shared/inputrules.ts +79 -0
- package/app/vendor/markdown-editor/src/flavors/shared/keymap.ts +89 -0
- package/app/vendor/markdown-editor/src/flavors/shared/placeholder.ts +24 -0
- package/app/vendor/markdown-editor/src/flavors/shared/plugins.ts +58 -0
- package/app/vendor/markdown-editor/src/flavors/types.ts +22 -0
- package/app/vendor/markdown-editor/src/formats/registry.ts +45 -0
- package/app/vendor/markdown-editor/src/icons.tsx +120 -0
- package/app/vendor/markdown-editor/src/index.ts +23 -0
- package/app/vendor/markdown-editor/src/theme.ts +249 -0
- package/app/vendor/markdown-editor/src/types.ts +58 -0
- package/app/vendor/plugin-sdk/src/__tests__/documentActions.test.ts +108 -0
- package/app/vendor/plugin-sdk/src/__tests__/loader.test.ts +75 -0
- package/app/vendor/plugin-sdk/src/__tests__/registry.test.ts +148 -0
- package/app/vendor/plugin-sdk/src/index.ts +33 -0
- package/app/vendor/plugin-sdk/src/loader.ts +45 -0
- package/app/vendor/plugin-sdk/src/navkeys.ts +17 -0
- package/app/vendor/plugin-sdk/src/react.tsx +155 -0
- package/app/vendor/plugin-sdk/src/registry.ts +337 -0
- package/app/vendor/plugin-sdk/src/types.ts +230 -0
- package/app/vendor/realtime/src/__tests__/pure.test.ts +58 -0
- package/app/vendor/realtime/src/__tests__/seeded-room.base64 +1 -0
- package/app/vendor/realtime/src/__tests__/seeding.test.ts +70 -0
- package/app/vendor/realtime/src/collab.ts +308 -0
- package/app/vendor/realtime/src/hooks.ts +57 -0
- package/app/vendor/realtime/src/index.ts +12 -0
- package/app/vendor/realtime/src/pure.ts +43 -0
- package/app/vite.config.mjs +59 -0
- package/bin/gogitcms-editor.mjs +168 -0
- package/npm-shrinkwrap.json +5696 -0
- package/package.json +74 -0
- package/src/commands/build.mjs +100 -0
- package/src/commands/dev.mjs +186 -0
- package/src/commands/init.mjs +144 -0
- package/src/commands/login.mjs +116 -0
- package/src/commands/status.mjs +68 -0
- package/src/lib/api.mjs +122 -0
- package/src/lib/appRoot.mjs +51 -0
- package/src/lib/baked.json +3 -0
- package/src/lib/config.mjs +108 -0
- package/src/lib/credentials.mjs +91 -0
- package/src/lib/defaults.mjs +26 -0
- package/src/lib/graphql.mjs +28 -0
- package/src/lib/localServer.mjs +206 -0
- package/src/lib/open.mjs +23 -0
- package/src/lib/plugins.mjs +164 -0
- package/src/lib/tokenBroker.mjs +85 -0
- package/src/tui/prompts.mjs +92 -0
- package/src/tui/screen.mjs +282 -0
- package/src/tui/theme.mjs +40 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Svg, { Path } from "react-native-svg";
|
|
3
|
+
import { icons, IconName } from "../icons";
|
|
4
|
+
|
|
5
|
+
export type IconProps = {
|
|
6
|
+
name: IconName;
|
|
7
|
+
size?: number;
|
|
8
|
+
color?: string;
|
|
9
|
+
strokeWidth?: number;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// Native: react-native-svg. (Web uses Icon.web.tsx via platform resolution.)
|
|
13
|
+
export function Icon({ name, size = 18, color = "#000", strokeWidth = 1.5 }: IconProps) {
|
|
14
|
+
return (
|
|
15
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
16
|
+
{icons[name].map((d, i) => (
|
|
17
|
+
<Path
|
|
18
|
+
key={i}
|
|
19
|
+
d={d}
|
|
20
|
+
stroke={color}
|
|
21
|
+
strokeWidth={strokeWidth}
|
|
22
|
+
strokeLinecap="round"
|
|
23
|
+
strokeLinejoin="round"
|
|
24
|
+
/>
|
|
25
|
+
))}
|
|
26
|
+
</Svg>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { icons, IconName } from "../icons";
|
|
3
|
+
|
|
4
|
+
export type IconProps = {
|
|
5
|
+
name: IconName;
|
|
6
|
+
size?: number;
|
|
7
|
+
color?: string;
|
|
8
|
+
strokeWidth?: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// Web: a raw <svg> renders directly inside the react-native-web DOM tree.
|
|
12
|
+
export function Icon({ name, size = 18, color = "currentColor", strokeWidth = 1.5 }: IconProps) {
|
|
13
|
+
return (
|
|
14
|
+
<svg
|
|
15
|
+
width={size}
|
|
16
|
+
height={size}
|
|
17
|
+
viewBox="0 0 24 24"
|
|
18
|
+
fill="none"
|
|
19
|
+
stroke={color}
|
|
20
|
+
strokeWidth={strokeWidth}
|
|
21
|
+
strokeLinecap="round"
|
|
22
|
+
strokeLinejoin="round"
|
|
23
|
+
style={{ display: "block", flexShrink: 0 }}
|
|
24
|
+
aria-hidden
|
|
25
|
+
>
|
|
26
|
+
{icons[name].map((d, i) => (
|
|
27
|
+
<path key={i} d={d} />
|
|
28
|
+
))}
|
|
29
|
+
</svg>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
2
|
+
import { View, TextInput, StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
import { useTheme } from "../ThemeProvider";
|
|
4
|
+
import { Text } from "./Text";
|
|
5
|
+
|
|
6
|
+
export type InputProps = {
|
|
7
|
+
value: string;
|
|
8
|
+
onChangeText: (text: string) => void;
|
|
9
|
+
label?: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
secureTextEntry?: boolean;
|
|
12
|
+
mono?: boolean;
|
|
13
|
+
autoCapitalize?: "none" | "sentences" | "words" | "characters";
|
|
14
|
+
size?: "md" | "lg";
|
|
15
|
+
autoFocus?: boolean;
|
|
16
|
+
onSubmitEditing?: () => void;
|
|
17
|
+
keyboardType?: "default" | "numeric";
|
|
18
|
+
// editable defaults to true; false renders a muted, read-only field (still
|
|
19
|
+
// shows the value) — used to reflect a permission the caller lacks.
|
|
20
|
+
editable?: boolean;
|
|
21
|
+
// error highlights the field with the danger border color (e.g. a failed save
|
|
22
|
+
// or validation naming this field).
|
|
23
|
+
error?: boolean;
|
|
24
|
+
style?: StyleProp<ViewStyle>;
|
|
25
|
+
testID?: string;
|
|
26
|
+
// Optional focus/blur passthroughs (used by collaborative presence tracking).
|
|
27
|
+
onFocus?: () => void;
|
|
28
|
+
onBlur?: () => void;
|
|
29
|
+
// When this number changes to a truthy value, the field programmatically
|
|
30
|
+
// focuses itself (used to jump to a peer's field from a presence avatar).
|
|
31
|
+
focusSignal?: number;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export function Input({
|
|
35
|
+
value,
|
|
36
|
+
onChangeText,
|
|
37
|
+
label,
|
|
38
|
+
placeholder,
|
|
39
|
+
secureTextEntry,
|
|
40
|
+
mono,
|
|
41
|
+
autoCapitalize = "none",
|
|
42
|
+
size = "lg",
|
|
43
|
+
autoFocus,
|
|
44
|
+
onSubmitEditing,
|
|
45
|
+
keyboardType,
|
|
46
|
+
editable = true,
|
|
47
|
+
error = false,
|
|
48
|
+
style,
|
|
49
|
+
testID,
|
|
50
|
+
onFocus,
|
|
51
|
+
onBlur,
|
|
52
|
+
focusSignal,
|
|
53
|
+
}: InputProps) {
|
|
54
|
+
const t = useTheme();
|
|
55
|
+
const [focused, setFocused] = useState(false);
|
|
56
|
+
const ref = useRef<TextInput>(null);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (focusSignal) ref.current?.focus();
|
|
59
|
+
}, [focusSignal]);
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<View style={[{ gap: t.space(2) }, style]}>
|
|
63
|
+
{label ? (
|
|
64
|
+
<Text variant="label" color="tertiary">
|
|
65
|
+
{label}
|
|
66
|
+
</Text>
|
|
67
|
+
) : null}
|
|
68
|
+
<TextInput
|
|
69
|
+
ref={ref}
|
|
70
|
+
testID={testID}
|
|
71
|
+
accessibilityLabel={label}
|
|
72
|
+
value={value}
|
|
73
|
+
onChangeText={onChangeText}
|
|
74
|
+
editable={editable}
|
|
75
|
+
placeholder={placeholder}
|
|
76
|
+
placeholderTextColor={t.color.textTertiary}
|
|
77
|
+
secureTextEntry={secureTextEntry}
|
|
78
|
+
autoCapitalize={autoCapitalize}
|
|
79
|
+
autoFocus={autoFocus}
|
|
80
|
+
onSubmitEditing={onSubmitEditing}
|
|
81
|
+
keyboardType={keyboardType}
|
|
82
|
+
onFocus={() => { setFocused(true); onFocus?.(); }}
|
|
83
|
+
onBlur={() => { setFocused(false); onBlur?.(); }}
|
|
84
|
+
// @ts-expect-error react-native-web accepts CSS outline; RN's TextStyle
|
|
85
|
+
// has no outlineStyle, and the mismatch is reported on the whole style
|
|
86
|
+
// object rather than on the property, so the suppression belongs here.
|
|
87
|
+
style={{
|
|
88
|
+
height: t.control[size],
|
|
89
|
+
paddingHorizontal: t.space(3),
|
|
90
|
+
borderRadius: t.radius.md,
|
|
91
|
+
borderWidth: 1,
|
|
92
|
+
borderColor: error
|
|
93
|
+
? t.color.diffDelFg
|
|
94
|
+
: focused && editable
|
|
95
|
+
? t.color.borderStrong
|
|
96
|
+
: t.color.borderDefault,
|
|
97
|
+
backgroundColor: editable ? t.color.surfaceRaised : t.color.surfaceSunken,
|
|
98
|
+
color: editable ? t.color.textPrimary : t.color.textSecondary,
|
|
99
|
+
fontFamily: mono ? t.font.mono : t.font.sans,
|
|
100
|
+
fontSize: mono ? t.type.mono.size : t.type.body.size,
|
|
101
|
+
outlineStyle: "none",
|
|
102
|
+
}}
|
|
103
|
+
/>
|
|
104
|
+
</View>
|
|
105
|
+
);
|
|
106
|
+
}
|