This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PiniaPlugin, StateTree } from "pinia"; | |
const PREFIX = "pinia:"; | |
export interface PersistenceOptions<S extends StateTree> { | |
validate?: (state: StateTree) => state is S; | |
} | |
declare module "pinia" { | |
// eslint-disable-next-line no-undef, @typescript-eslint/no-unused-vars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import isEqual from "fast-deep-equal"; | |
import { PiniaPlugin, StateTree } from "pinia"; | |
import { onScopeDispose } from "vue"; | |
// Web Locks API have very good support at this point, but it's disabled by | |
// Safari when lockdown mode is disabled. Let's gracefully handle this by not | |
// doing any of that initialization broadcast when it's not present. | |
const locks = navigator.locks as LockManager | undefined; | |
const PREFIX = "pinia-broadcast:"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { type JSONContent } from '@tiptap/core'; | |
import { graphemeLen } from '~/api/richtext/intl.ts'; | |
import { type Facet, type FacetLink } from '~/api/richtext/types.ts'; | |
const encoder = new TextEncoder(); | |
type SerializedMarks = NonNullable<JSONContent['marks']>; | |
const findFeature = (marks?: SerializedMarks): FacetLink | undefined => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "object", | |
"properties": { | |
"lexicon": { "type": "number", "const": 1 }, | |
"id": { | |
"type": "string", | |
"pattern": "^[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(\\.[a-zA-Z]([a-zA-Z]{0,61}[a-zA-Z])?)$" | |
}, | |
"revision": { "type": "integer", "minimum": 0 }, | |
"description": { "type": "string" }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Zed settings | |
// | |
// For information on how to configure Zed, see the Zed | |
// documentation: https://zed.dev/docs/configuring-zed | |
// | |
// To see all of Zed's default settings without changing your | |
// custom settings, run the `open default settings` command | |
// from the command palette or from `Zed` application menu. | |
{ | |
"project_panel": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script setup lang="ts"> | |
import { computed } from 'vue'; | |
import { type RouteLocationNormalizedLoaded as LoadedRouteLocation, RouterView, useRoute } from 'vue-router'; | |
import { assert } from '~/utils/misc.ts'; | |
const route = useRoute(); | |
const handleModalRoute = (route: LoadedRouteLocation): LoadedRouteLocation => { | |
// on modal routes, we only want the actual modal itself to be rendered |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ty @retr0id | |
const getUtf8Size = (str: string, index: number): number => { | |
const code = str.codePointAt(index)!; | |
if (code <= 0x7f) { | |
return 1; | |
} else if (code <= 0x7ff) { | |
return 2; | |
} else if (code <= 0xffff) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const createLock = () => { | |
let promise = Promise.resolve(); | |
return { | |
async acquire(): Promise<Disposable> { | |
const { promise: next, resolve } = Promise.withResolvers<void>(); | |
const prev = promise; | |
promise = next; | |
await prev; |
We can't make this file beautiful and searchable because it's too large.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
did:plc:ragtjsm2j2vknwkz3zp4oxrd,2022-11-17T00:35:16.391Z | |
did:plc:l3rouwludahu3ui3bt66mfvj,2022-11-17T00:39:19.084Z | |
did:plc:vpkhqolt662uhesyj6nxm7ys,2022-11-17T01:04:43.624Z | |
did:plc:yk4dd2qkboz2yv6tpubpc6co,2022-11-17T01:07:13.996Z | |
did:plc:6uow4ajxchftgyvvppnqa6uj,2022-11-17T03:30:47.787Z | |
did:plc:oky5czdrnfjpqslsw2a5iclo,2022-11-17T06:31:40.296Z | |
did:plc:7axcqwj4roha6mqpdhpdwczx,2022-11-18T01:31:55.110Z | |
did:plc:6fktaamhhxdqb2ypum33kbkj,2022-11-18T03:23:32.417Z | |
did:plc:vzmlifz3ghar4cu2hj3srga2,2022-11-18T10:22:57.934Z | |
did:plc:jo6qdnxnyqdio6cq36xgc6tx,2022-11-18T11:41:49.052Z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type FormatAttributes = { | |
'color'?: string; | |
'font-style'?: string; | |
'font-weight'?: string; | |
'text-decoration'?: string; | |
}; | |
export interface FormattedContent { | |
children: string | (string | FormattedContent)[]; | |
attrs: FormatAttributes; |
NewerOlder