@atmo-dev/kit 0.14.0 → 0.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/dist/components/ExternalEmbed.svelte +30 -29
- package/dist/components/ExternalEmbed.svelte.d.ts +8 -0
- package/dist/components/InlineEditor.svelte +15 -95
- package/dist/components/InlineEditor.svelte.d.ts +1 -1
- package/dist/components/LinkCard.svelte +54 -25
- package/dist/components/LinkCard.svelte.d.ts +2 -0
- package/dist/components/LinkEmbed.svelte +75 -0
- package/dist/components/LinkEmbed.svelte.d.ts +13 -0
- package/dist/components/PostContent.svelte +12 -3
- package/dist/components/PostContent.svelte.d.ts +3 -0
- package/dist/components/RichText.svelte +47 -5
- package/dist/components/RichText.svelte.d.ts +5 -2
- package/dist/components/RichTextEditor.svelte +271 -0
- package/dist/components/RichTextEditor.svelte.d.ts +44 -0
- package/dist/components/composer/AltText.svelte +63 -0
- package/dist/components/composer/AltText.svelte.d.ts +11 -0
- package/dist/components/composer/CharRing.svelte +39 -0
- package/dist/components/composer/CharRing.svelte.d.ts +7 -0
- package/dist/components/composer/ComposerPost.svelte +321 -0
- package/dist/components/composer/ComposerPost.svelte.d.ts +29 -0
- package/dist/components/composer/Drafts.svelte +82 -0
- package/dist/components/composer/Drafts.svelte.d.ts +9 -0
- package/dist/components/composer/EmojiPicker.svelte +55 -0
- package/dist/components/composer/EmojiPicker.svelte.d.ts +7 -0
- package/dist/components/composer/GifPicker.svelte +118 -0
- package/dist/components/composer/GifPicker.svelte.d.ts +11 -0
- package/dist/components/composer/PostComposer.svelte +599 -0
- package/dist/components/composer/PostComposer.svelte.d.ts +71 -0
- package/dist/components/composer/PostComposerDialog.svelte +75 -0
- package/dist/components/composer/PostComposerDialog.svelte.d.ts +10 -0
- package/dist/components/composer/ReplySettings.svelte +150 -0
- package/dist/components/composer/ReplySettings.svelte.d.ts +18 -0
- package/dist/components/login/search.d.ts +29 -1
- package/dist/components/login/search.js +31 -3
- package/dist/editor/EditorLinkEmbed.svelte +35 -0
- package/dist/editor/EditorLinkEmbed.svelte.d.ts +12 -0
- package/dist/editor/detect-plugin.d.ts +5 -0
- package/dist/editor/detect-plugin.js +51 -0
- package/dist/editor/document.d.ts +17 -0
- package/dist/editor/document.js +269 -0
- package/dist/editor/link-embed-node.d.ts +17 -0
- package/dist/editor/link-embed-node.js +96 -0
- package/dist/editor/markdown-extensions.d.ts +6 -0
- package/dist/editor/markdown-extensions.js +42 -0
- package/dist/editor/markdown.d.ts +3 -0
- package/dist/editor/markdown.js +4 -0
- package/dist/embeds/PlayerLinkEmbed.svelte +9 -0
- package/dist/embeds/PlayerLinkEmbed.svelte.d.ts +7 -0
- package/dist/{events/event-view → embeds}/PostLinkEmbed.svelte +7 -7
- package/dist/{events/event-view → embeds}/PostLinkEmbed.svelte.d.ts +1 -1
- package/dist/{events/event-view → embeds}/ProfileLinkEmbed.svelte +7 -7
- package/dist/{events/event-view → embeds}/ProfileLinkEmbed.svelte.d.ts +1 -1
- package/dist/embeds/context.d.ts +10 -0
- package/dist/embeds/context.js +20 -0
- package/dist/embeds/defaults.d.ts +27 -0
- package/dist/embeds/defaults.js +38 -0
- package/dist/embeds/resolve.d.ts +9 -0
- package/dist/embeds/resolve.js +27 -0
- package/dist/embeds/types.d.ts +39 -0
- package/dist/embeds/types.js +1 -0
- package/dist/events/EventEditor.svelte +7 -6
- package/dist/events/EventView.svelte +21 -38
- package/dist/events/PostToBlueskyModal.svelte +12 -4
- package/dist/events/event-link-embed.d.ts +22 -0
- package/dist/events/event-link-embed.js +15 -0
- package/dist/events/event-view/EventLinkEmbed.svelte +12 -30
- package/dist/events/event-view/EventLinkEmbed.svelte.d.ts +3 -12
- package/dist/events.d.ts +2 -0
- package/dist/events.js +1 -0
- package/dist/index.d.ts +16 -2
- package/dist/index.js +10 -2
- package/dist/richtext/detect.js +1 -1
- package/dist/richtext/document.d.ts +10 -0
- package/dist/richtext/document.js +44 -4
- package/dist/richtext/markdown.js +5 -1
- package/dist/richtext/serialize.d.ts +11 -0
- package/dist/richtext/serialize.js +462 -0
- package/dist/richtext.d.ts +1 -0
- package/dist/richtext.js +1 -0
- package/dist/social/MentionOptions.svelte +30 -0
- package/dist/social/MentionOptions.svelte.d.ts +12 -0
- package/dist/social/composer.d.ts +143 -0
- package/dist/social/composer.js +141 -0
- package/dist/social/{mention-suggestions.d.ts → mention-suggestions.svelte.d.ts} +1 -1
- package/dist/social/{mention-suggestions.js → mention-suggestions.svelte.js} +36 -46
- package/dist/social/richtext.js +2 -0
- package/dist/social.d.ts +2 -0
- package/dist/social.js +1 -0
- package/dist/styles.d.ts +5 -0
- package/dist/styles.js +5 -0
- package/package.json +4 -1
- package/dist/components/PostComposer.svelte +0 -41
- package/dist/components/PostComposer.svelte.d.ts +0 -16
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export const defaultComposerLimits = {
|
|
2
|
+
length: 300,
|
|
3
|
+
images: 4,
|
|
4
|
+
posts: 25,
|
|
5
|
+
videoBytes: 300_000_000,
|
|
6
|
+
captionBytes: 20_000,
|
|
7
|
+
languages: 3,
|
|
8
|
+
altLength: 2000
|
|
9
|
+
};
|
|
10
|
+
export const defaultContentWarnings = [
|
|
11
|
+
{ value: 'sexual', label: 'Suggestive' },
|
|
12
|
+
{ value: 'nudity', label: 'Nudity' },
|
|
13
|
+
{ value: 'porn', label: 'Adult' },
|
|
14
|
+
{ value: 'graphic-media', label: 'Graphic media' }
|
|
15
|
+
];
|
|
16
|
+
export const defaultComposerLanguages = [
|
|
17
|
+
'en',
|
|
18
|
+
'de',
|
|
19
|
+
'es',
|
|
20
|
+
'fr',
|
|
21
|
+
'it',
|
|
22
|
+
'pt',
|
|
23
|
+
'nl',
|
|
24
|
+
'pl',
|
|
25
|
+
'sv',
|
|
26
|
+
'da',
|
|
27
|
+
'fi',
|
|
28
|
+
'nb',
|
|
29
|
+
'cs',
|
|
30
|
+
'tr',
|
|
31
|
+
'uk',
|
|
32
|
+
'ru',
|
|
33
|
+
'el',
|
|
34
|
+
'he',
|
|
35
|
+
'ar',
|
|
36
|
+
'fa',
|
|
37
|
+
'hi',
|
|
38
|
+
'id',
|
|
39
|
+
'th',
|
|
40
|
+
'vi',
|
|
41
|
+
'ko',
|
|
42
|
+
'ja',
|
|
43
|
+
'zh'
|
|
44
|
+
];
|
|
45
|
+
export const browserLanguage = () => typeof navigator === 'undefined' ? 'en' : navigator.language.split('-')[0];
|
|
46
|
+
export function blankComposerPost(text = '') {
|
|
47
|
+
return { id: crypto.randomUUID(), text, facets: [], images: [], label: '' };
|
|
48
|
+
}
|
|
49
|
+
/** Free the object URLs of attached files once posts are discarded. */
|
|
50
|
+
export function releaseComposerPosts(posts) {
|
|
51
|
+
for (const post of posts) {
|
|
52
|
+
for (const image of post.images)
|
|
53
|
+
URL.revokeObjectURL(image.url);
|
|
54
|
+
if (post.video)
|
|
55
|
+
URL.revokeObjectURL(post.video.url);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export function videoDimensions(file) {
|
|
59
|
+
return new Promise((resolve) => {
|
|
60
|
+
const video = document.createElement('video');
|
|
61
|
+
const url = URL.createObjectURL(file);
|
|
62
|
+
const done = (width, height) => {
|
|
63
|
+
URL.revokeObjectURL(url);
|
|
64
|
+
resolve({ width, height });
|
|
65
|
+
};
|
|
66
|
+
video.onloadedmetadata = () => done(video.videoWidth, video.videoHeight);
|
|
67
|
+
video.onerror = () => done(0, 0);
|
|
68
|
+
video.src = url;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
const slug = (url) => url
|
|
72
|
+
?.split('/')
|
|
73
|
+
.pop()
|
|
74
|
+
?.replace(/\.[^.]+$/, '');
|
|
75
|
+
/**
|
|
76
|
+
* GIF search through Bluesky's Klipy service. Posted links carry the size and video
|
|
77
|
+
* formats that `klipyEmbedProvider` and other clients read.
|
|
78
|
+
*/
|
|
79
|
+
export const blueskyGifSearch = async (query, cursor, signal) => {
|
|
80
|
+
const params = new URLSearchParams({
|
|
81
|
+
client_key: 'bluesky-web',
|
|
82
|
+
limit: '30',
|
|
83
|
+
contentfilter: 'low'
|
|
84
|
+
});
|
|
85
|
+
const region = navigator.language.split('-')[1];
|
|
86
|
+
if (region)
|
|
87
|
+
params.set('locale', region.toLowerCase());
|
|
88
|
+
if (query)
|
|
89
|
+
params.set('q', query);
|
|
90
|
+
if (cursor)
|
|
91
|
+
params.set('pos', cursor);
|
|
92
|
+
const response = await fetch(`https://gifs.bsky.app/klipy/v2/${query ? 'search' : 'featured'}?${params}`, { signal });
|
|
93
|
+
if (!response.ok)
|
|
94
|
+
throw new Error('GIF search is unavailable');
|
|
95
|
+
const body = (await response.json());
|
|
96
|
+
const gifs = [];
|
|
97
|
+
for (const gif of body.results ?? []) {
|
|
98
|
+
const formats = gif.media_formats;
|
|
99
|
+
const full = formats.gif;
|
|
100
|
+
if (!full)
|
|
101
|
+
continue;
|
|
102
|
+
const hints = new URLSearchParams({ hh: String(full.dims[1]), ww: String(full.dims[0]) });
|
|
103
|
+
const mp4 = slug(formats.mp4?.url);
|
|
104
|
+
const webm = slug(formats.webm?.url);
|
|
105
|
+
if (mp4)
|
|
106
|
+
hints.set('mp4', mp4);
|
|
107
|
+
if (webm)
|
|
108
|
+
hints.set('webm', webm);
|
|
109
|
+
gifs.push({
|
|
110
|
+
id: gif.id,
|
|
111
|
+
uri: `${full.url}?${hints}`,
|
|
112
|
+
title: gif.content_description || gif.title || 'GIF',
|
|
113
|
+
alt: '',
|
|
114
|
+
preview: (formats.tinygif ?? full).url,
|
|
115
|
+
thumb: (formats.preview ?? formats.gifpreview ?? full).url,
|
|
116
|
+
width: full.dims[0],
|
|
117
|
+
height: full.dims[1]
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return { gifs, cursor: body.next || undefined };
|
|
121
|
+
};
|
|
122
|
+
/** Link preview metadata from Bluesky's card service. */
|
|
123
|
+
export const blueskyLinkPreview = async (uri, signal) => {
|
|
124
|
+
try {
|
|
125
|
+
const response = await fetch(`https://cardyb.bsky.app/v1/extract?url=${encodeURIComponent(uri)}`, { signal });
|
|
126
|
+
if (!response.ok)
|
|
127
|
+
return;
|
|
128
|
+
const data = await response.json();
|
|
129
|
+
if (data.error)
|
|
130
|
+
return;
|
|
131
|
+
return {
|
|
132
|
+
uri,
|
|
133
|
+
title: String(data.title ?? ''),
|
|
134
|
+
description: String(data.description ?? ''),
|
|
135
|
+
image: typeof data.image === 'string' && data.image ? data.image : undefined
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Editor } from '@tiptap/core';
|
|
2
2
|
import type { ActorSearch, ActorSummary } from '../components/login/types.js';
|
|
3
|
-
/**
|
|
3
|
+
/** Rows are rendered by Svelte, so profile data never becomes HTML. */
|
|
4
4
|
export declare function mentionSuggestions(search: ActorSearch, host: () => HTMLElement): {
|
|
5
5
|
char: string;
|
|
6
6
|
debounce: number;
|
|
@@ -1,70 +1,58 @@
|
|
|
1
|
-
|
|
1
|
+
import { mount, unmount } from 'svelte';
|
|
2
|
+
import MentionOptions from './MentionOptions.svelte';
|
|
3
|
+
/** Rows are rendered by Svelte, so profile data never becomes HTML. */
|
|
2
4
|
export function mentionSuggestions(search, host) {
|
|
3
5
|
let controller;
|
|
4
6
|
let menu;
|
|
5
|
-
let
|
|
7
|
+
let options;
|
|
6
8
|
let current;
|
|
9
|
+
const state = $state({
|
|
10
|
+
id: '',
|
|
11
|
+
items: [],
|
|
12
|
+
selected: 0,
|
|
13
|
+
choose: (index) => {
|
|
14
|
+
const actor = current.items[index];
|
|
15
|
+
if (actor)
|
|
16
|
+
current.command({ id: actor.did, label: actor.handle });
|
|
17
|
+
}
|
|
18
|
+
});
|
|
7
19
|
const close = () => {
|
|
20
|
+
if (options)
|
|
21
|
+
void unmount(options);
|
|
22
|
+
options = undefined;
|
|
8
23
|
menu?.remove();
|
|
9
24
|
menu = undefined;
|
|
10
25
|
current?.editor.view.dom.removeAttribute('aria-controls');
|
|
11
26
|
current?.editor.view.dom.removeAttribute('aria-activedescendant');
|
|
12
27
|
current?.editor.view.dom.setAttribute('aria-expanded', 'false');
|
|
13
28
|
};
|
|
14
|
-
const choose = (index) => {
|
|
15
|
-
const actor = current.items[index];
|
|
16
|
-
if (actor)
|
|
17
|
-
current.command({ id: actor.did, label: actor.handle });
|
|
18
|
-
};
|
|
19
29
|
function draw() {
|
|
20
30
|
if (!menu)
|
|
21
31
|
return;
|
|
22
|
-
|
|
32
|
+
state.items = current.items;
|
|
23
33
|
const rect = current.clientRect?.();
|
|
24
34
|
const bounds = host().getBoundingClientRect();
|
|
25
35
|
if (rect) {
|
|
26
36
|
menu.style.top = `${rect.bottom - bounds.top + host().scrollTop + 6}px`;
|
|
27
|
-
menu.style.left = `${Math.max(0, Math.min(rect.left - bounds.left, bounds.width -
|
|
37
|
+
menu.style.left = `${Math.max(0, Math.min(rect.left - bounds.left, bounds.width - 288))}px`;
|
|
28
38
|
}
|
|
39
|
+
// Nothing to choose from: stay out of the way instead of saying so.
|
|
40
|
+
menu.hidden = !current.items.length;
|
|
29
41
|
if (!current.items.length) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
empty.className = 'p-3 text-xs text-base-600 dark:text-base-400';
|
|
35
|
-
empty.textContent = 'No accounts found';
|
|
36
|
-
menu.append(empty);
|
|
42
|
+
current.editor.view.dom.removeAttribute('aria-controls');
|
|
43
|
+
current.editor.view.dom.removeAttribute('aria-activedescendant');
|
|
44
|
+
current.editor.view.dom.setAttribute('aria-expanded', 'false');
|
|
45
|
+
return;
|
|
37
46
|
}
|
|
38
|
-
current.items.forEach((actor, index) => {
|
|
39
|
-
const option = document.createElement('button');
|
|
40
|
-
option.type = 'button';
|
|
41
|
-
option.role = 'option';
|
|
42
|
-
option.id = `${menu.id}-${index}`;
|
|
43
|
-
option.setAttribute('aria-selected', String(index === selected));
|
|
44
|
-
option.className =
|
|
45
|
-
'block w-full rounded-ui px-3 py-2 text-left text-xs text-base-950 dark:text-base-50 hover:bg-[color-mix(in_srgb,var(--base-100)_75%,var(--base-200))] dark:hover:bg-base-950 aria-selected:bg-[color-mix(in_srgb,var(--base-100)_75%,var(--base-200))] dark:aria-selected:bg-base-950';
|
|
46
|
-
const name = document.createElement('strong');
|
|
47
|
-
name.className = 'block truncate font-medium';
|
|
48
|
-
name.textContent = actor.displayName || actor.handle;
|
|
49
|
-
const handle = document.createElement('span');
|
|
50
|
-
handle.className = 'block truncate text-base-600 dark:text-base-400';
|
|
51
|
-
handle.textContent = `@${actor.handle}`;
|
|
52
|
-
option.append(name, handle);
|
|
53
|
-
option.onmousedown = (event) => event.preventDefault();
|
|
54
|
-
option.onclick = () => choose(index);
|
|
55
|
-
menu.append(option);
|
|
56
|
-
});
|
|
57
47
|
current.editor.view.dom.setAttribute('aria-controls', menu.id);
|
|
58
48
|
current.editor.view.dom.setAttribute('aria-expanded', 'true');
|
|
59
|
-
|
|
60
|
-
current.editor.view.dom.setAttribute('aria-activedescendant', `${menu.id}-${selected}`);
|
|
61
|
-
else
|
|
62
|
-
current.editor.view.dom.removeAttribute('aria-activedescendant');
|
|
49
|
+
current.editor.view.dom.setAttribute('aria-activedescendant', `${menu.id}-${state.selected}`);
|
|
63
50
|
}
|
|
64
51
|
return {
|
|
65
52
|
char: '@',
|
|
66
53
|
debounce: 200,
|
|
67
|
-
|
|
54
|
+
// One letter matches almost anyone; wait for a second one.
|
|
55
|
+
minQueryLength: 2,
|
|
68
56
|
items: async ({ query }) => {
|
|
69
57
|
controller?.abort();
|
|
70
58
|
controller = new AbortController();
|
|
@@ -78,19 +66,21 @@ export function mentionSuggestions(search, host) {
|
|
|
78
66
|
render: () => ({
|
|
79
67
|
onStart: (props) => {
|
|
80
68
|
current = props;
|
|
81
|
-
selected = 0;
|
|
69
|
+
state.selected = 0;
|
|
82
70
|
menu = document.createElement('div');
|
|
83
71
|
menu.id = `${props.editor.view.dom.id}-mentions`;
|
|
84
72
|
menu.role = 'listbox';
|
|
85
73
|
menu.setAttribute('aria-label', 'Mention suggestions');
|
|
86
74
|
menu.className =
|
|
87
|
-
'absolute z-60 w-
|
|
75
|
+
'absolute z-60 w-72 max-w-full overflow-hidden rounded-ui border border-base-300 bg-[color-mix(in_srgb,var(--base-100)_75%,var(--base-200))] p-1.5 font-sans text-base-950 dark:border-[color-mix(in_srgb,var(--base-800)_80%,var(--base-950))] dark:bg-base-975 dark:text-base-50';
|
|
76
|
+
state.id = menu.id;
|
|
88
77
|
host().append(menu);
|
|
78
|
+
options = mount(MentionOptions, { target: menu, props: { state } });
|
|
89
79
|
draw();
|
|
90
80
|
},
|
|
91
81
|
onUpdate: (props) => {
|
|
92
82
|
current = props;
|
|
93
|
-
selected = 0;
|
|
83
|
+
state.selected = 0;
|
|
94
84
|
draw();
|
|
95
85
|
},
|
|
96
86
|
onKeyDown: ({ event }) => {
|
|
@@ -101,14 +91,14 @@ export function mentionSuggestions(search, host) {
|
|
|
101
91
|
if (!current.items.length)
|
|
102
92
|
return false;
|
|
103
93
|
if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
104
|
-
selected =
|
|
105
|
-
(selected + (event.key === 'ArrowDown' ? 1 : -1) + current.items.length) %
|
|
94
|
+
state.selected =
|
|
95
|
+
(state.selected + (event.key === 'ArrowDown' ? 1 : -1) + current.items.length) %
|
|
106
96
|
current.items.length;
|
|
107
97
|
draw();
|
|
108
98
|
return true;
|
|
109
99
|
}
|
|
110
100
|
if (event.key === 'Enter' || event.key === 'Tab') {
|
|
111
|
-
choose(selected);
|
|
101
|
+
state.choose(state.selected);
|
|
112
102
|
return true;
|
|
113
103
|
}
|
|
114
104
|
return false;
|
package/dist/social/richtext.js
CHANGED
|
@@ -18,6 +18,8 @@ export function editorJsonToBlueskyPost(doc) {
|
|
|
18
18
|
text += node.text ?? '';
|
|
19
19
|
else if (node.type === 'hardBreak')
|
|
20
20
|
text += '\n';
|
|
21
|
+
else if (node.type === 'linkEmbed')
|
|
22
|
+
text += typeof node.attrs?.url === 'string' ? node.attrs.url : '';
|
|
21
23
|
else if (node.type === 'mention') {
|
|
22
24
|
const label = `@${node.attrs?.label ?? node.attrs?.id ?? ''}`;
|
|
23
25
|
const byteStart = bytes(text);
|
package/dist/social.d.ts
CHANGED
|
@@ -5,3 +5,5 @@ export type { ExternalPostEmbed, ExternalEmbedProvider, ExternalEmbedPlayer } fr
|
|
|
5
5
|
export { blueskyPostToPostData, hasModerationLabel } from './social/posts.js';
|
|
6
6
|
export type { PostData, PostEmbed, BlueskyPostView } from './social/posts.js';
|
|
7
7
|
export { blueskyProfileUrl, socialProfileUrl, socialPostUrl, socialHashtagUrl, parseSocialPostUrl, parseSocialProfileUrl } from './social/urls.js';
|
|
8
|
+
export { blueskyGifSearch, blueskyLinkPreview, defaultComposerLimits, defaultComposerLanguages, defaultContentWarnings } from './social/composer.js';
|
|
9
|
+
export type { ComposerContent, ComposerPost, ComposerImage, ComposerVideo, ComposerGif, ComposerLink, ComposerReplyRule, ComposerLimits, ComposerFeatures, ComposerLabels, ComposerGifSearch, ComposerGifResult, ComposerLinkPreview, ComposerDrafts, ComposerDraftSummary, ComposerContentWarning } from './social/composer.js';
|
package/dist/social.js
CHANGED
|
@@ -2,3 +2,4 @@ export { PREFERRED_CLIENT_COLLECTION, PREFERRED_CLIENT_RKEY, PREFERRED_CLIENT_SC
|
|
|
2
2
|
export { defaultExternalEmbedProviders, youtubeEmbedProvider, klipyEmbedProvider, resolveExternalEmbed } from './social/external-embeds.js';
|
|
3
3
|
export { blueskyPostToPostData, hasModerationLabel } from './social/posts.js';
|
|
4
4
|
export { blueskyProfileUrl, socialProfileUrl, socialPostUrl, socialHashtagUrl, parseSocialPostUrl, parseSocialProfileUrl } from './social/urls.js';
|
|
5
|
+
export { blueskyGifSearch, blueskyLinkPreview, defaultComposerLimits, defaultComposerLanguages, defaultContentWarnings } from './social/composer.js';
|
package/dist/styles.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
export declare const focus = "focus-visible:outline-2 focus-visible:outline-offset-3 focus-visible:outline-accent-700 dark:focus-visible:outline-accent-300";
|
|
2
2
|
export declare const control = "block min-h-11 w-full min-w-0 rounded-ui border border-base-300 dark:border-base-800 bg-[color-mix(in_srgb,var(--base-100)_75%,var(--base-200))] dark:bg-base-975 px-3 py-2.5 text-base leading-normal text-base-950 dark:text-base-50 shadow-[inset_0_2px_4px_color-mix(in_srgb,var(--base-950)_8%,transparent),inset_0_5px_12px_color-mix(in_srgb,var(--base-950)_2%,transparent)] dark:shadow-[inset_0_2px_4px_#0006,inset_0_5px_12px_#0002] placeholder:text-base-600 dark:placeholder:text-base-400 transition-colors duration-(--atmo-duration) motion-reduce:transition-none hover:border-base-400 dark:hover:border-base-700 focus:ring-0 focus:ring-offset-0 focus-visible:border-accent-700 dark:focus-visible:border-accent-300 focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-accent-700 dark:focus-visible:outline-accent-300 disabled:cursor-not-allowed disabled:opacity-45 disabled:hover:border-base-300 dark:disabled:hover:border-base-800 aria-invalid:border-accent-700 dark:aria-invalid:border-accent-300 aria-invalid:hover:border-accent-700 dark:aria-invalid:hover:border-accent-300 sm:text-sm";
|
|
3
|
+
export declare const line = "border-base-300 dark:border-[color-mix(in_srgb,var(--base-800)_80%,var(--base-950))]";
|
|
4
|
+
export declare const recess = "bg-[color-mix(in_srgb,var(--base-100)_75%,var(--base-200))] dark:bg-base-950";
|
|
5
|
+
export declare const muted = "text-base-600 dark:text-base-400";
|
|
6
|
+
export declare const action = "text-accent-700 dark:text-accent-300";
|
|
7
|
+
export declare const hoverRecess = "hover:bg-[color-mix(in_srgb,var(--base-100)_75%,var(--base-200))] dark:hover:bg-base-950";
|
package/dist/styles.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
// Shared Tailwind recipes, not an additional component stylesheet.
|
|
2
2
|
export const focus = 'focus-visible:outline-2 focus-visible:outline-offset-3 focus-visible:outline-accent-700 dark:focus-visible:outline-accent-300';
|
|
3
3
|
export const control = 'block min-h-11 w-full min-w-0 rounded-ui border border-base-300 dark:border-base-800 bg-[color-mix(in_srgb,var(--base-100)_75%,var(--base-200))] dark:bg-base-975 px-3 py-2.5 text-base leading-normal text-base-950 dark:text-base-50 shadow-[inset_0_2px_4px_color-mix(in_srgb,var(--base-950)_8%,transparent),inset_0_5px_12px_color-mix(in_srgb,var(--base-950)_2%,transparent)] dark:shadow-[inset_0_2px_4px_#0006,inset_0_5px_12px_#0002] placeholder:text-base-600 dark:placeholder:text-base-400 transition-colors duration-(--atmo-duration) motion-reduce:transition-none hover:border-base-400 dark:hover:border-base-700 focus:ring-0 focus:ring-offset-0 focus-visible:border-accent-700 dark:focus-visible:border-accent-300 focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-accent-700 dark:focus-visible:outline-accent-300 disabled:cursor-not-allowed disabled:opacity-45 disabled:hover:border-base-300 dark:disabled:hover:border-base-800 aria-invalid:border-accent-700 dark:aria-invalid:border-accent-300 aria-invalid:hover:border-accent-700 dark:aria-invalid:hover:border-accent-300 sm:text-sm';
|
|
4
|
+
export const line = 'border-base-300 dark:border-[color-mix(in_srgb,var(--base-800)_80%,var(--base-950))]';
|
|
5
|
+
export const recess = 'bg-[color-mix(in_srgb,var(--base-100)_75%,var(--base-200))] dark:bg-base-950';
|
|
6
|
+
export const muted = 'text-base-600 dark:text-base-400';
|
|
7
|
+
export const action = 'text-accent-700 dark:text-accent-300';
|
|
8
|
+
export const hoverRecess = 'hover:bg-[color-mix(in_srgb,var(--base-100)_75%,var(--base-200))] dark:hover:bg-base-950';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atmo-dev/kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "The shared UI foundation for Atmo apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -153,9 +153,12 @@
|
|
|
153
153
|
"@tiptap/extension-paragraph": "^3.32.0",
|
|
154
154
|
"@tiptap/extension-placeholder": "^3.32.0",
|
|
155
155
|
"@tiptap/extension-text": "^3.32.0",
|
|
156
|
+
"@tiptap/pm": "^3.32.0",
|
|
157
|
+
"@tiptap/starter-kit": "^3.32.0",
|
|
156
158
|
"bits-ui": "^2.20.2",
|
|
157
159
|
"canvas-confetti": "^1.9.4",
|
|
158
160
|
"clsx": "^2.1.1",
|
|
161
|
+
"emoji-picker-element": "^1.29.1",
|
|
159
162
|
"esm-env": "^1.2.2",
|
|
160
163
|
"h3-js": "^4.5.0",
|
|
161
164
|
"hls.js": "^1.7.3",
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Editor, JSONContent } from '@tiptap/core';
|
|
3
|
-
import InlineEditor from './InlineEditor.svelte';
|
|
4
|
-
import type { ActorSearch } from './login/types.js';
|
|
5
|
-
import { graphemeLength } from '../social/richtext.js';
|
|
6
|
-
let {
|
|
7
|
-
value = $bindable(''),
|
|
8
|
-
editor = $bindable<Editor | null>(null),
|
|
9
|
-
searchActors,
|
|
10
|
-
maxLength = 300,
|
|
11
|
-
disabled = false,
|
|
12
|
-
onupdate
|
|
13
|
-
}: {
|
|
14
|
-
value?: string;
|
|
15
|
-
editor?: Editor | null;
|
|
16
|
-
searchActors?: ActorSearch;
|
|
17
|
-
maxLength?: number;
|
|
18
|
-
disabled?: boolean;
|
|
19
|
-
onupdate?: (content: { text: string; json: JSONContent }) => void;
|
|
20
|
-
} = $props();
|
|
21
|
-
let length = $derived(graphemeLength(value));
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<InlineEditor
|
|
25
|
-
bind:value
|
|
26
|
-
bind:editor
|
|
27
|
-
label="Post text"
|
|
28
|
-
placeholder="What’s happening?"
|
|
29
|
-
{searchActors}
|
|
30
|
-
{disabled}
|
|
31
|
-
{onupdate}
|
|
32
|
-
class="min-h-24 text-sm leading-relaxed"
|
|
33
|
-
/>
|
|
34
|
-
<p
|
|
35
|
-
class={length > maxLength
|
|
36
|
-
? 'red mt-2 text-right text-xs text-accent-700 dark:text-accent-300'
|
|
37
|
-
: 'mt-2 text-right text-xs text-base-600 dark:text-base-400'}
|
|
38
|
-
aria-live="polite"
|
|
39
|
-
>
|
|
40
|
-
{length} / {maxLength}
|
|
41
|
-
</p>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Editor, JSONContent } from '@tiptap/core';
|
|
2
|
-
import type { ActorSearch } from './login/types.js';
|
|
3
|
-
type $$ComponentProps = {
|
|
4
|
-
value?: string;
|
|
5
|
-
editor?: Editor | null;
|
|
6
|
-
searchActors?: ActorSearch;
|
|
7
|
-
maxLength?: number;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
onupdate?: (content: {
|
|
10
|
-
text: string;
|
|
11
|
-
json: JSONContent;
|
|
12
|
-
}) => void;
|
|
13
|
-
};
|
|
14
|
-
declare const PostComposer: import("svelte").Component<$$ComponentProps, {}, "value" | "editor">;
|
|
15
|
-
type PostComposer = ReturnType<typeof PostComposer>;
|
|
16
|
-
export default PostComposer;
|