on main help sign in
cleanup and bug fix
994efeaJohn Hyde
bin/commit.sh+1−2
@@ -21,5 +21,4 @@ lensa() {
21 "http://localhost:$port" | xargs printf %s | sed 's/\\n/\n/g'
21 "http://localhost:$port" | xargs printf %s | sed 's/\\n/\n/g'
22}
22}
23
23
24−
25−lensa 'hood' "+hood/commit %$DESK"
24+lensa 'hood' "+hood/commit %$DESK"
bin/get_glob.sh+1−4
@@ -1,8 +1,5 @@
1#!/bin/bash
1#!/bin/bash
2−#
2+
3−# Taken from: https://github.com/timlucmiptev/btc-agents/blob/master/install.sh
4−# by ~timluc-miptev
5−#
6usage() { printf "Usage: $0 URBIT_GLOBBER_DESK_DIRECTORY" 1>&2; exit 1; }
3usage() { printf "Usage: $0 URBIT_GLOBBER_DESK_DIRECTORY" 1>&2; exit 1; }
7
4
8cdir=$(dirname $0)
5cdir=$(dirname $0)
desk/doc/usr/sigil.udon+1−1
@@ -1,4 +1,4 @@
1;>
1;>
2# What is a Sigil?
2# What is a Sigil?
3
3
4−TODO: write this doc
4+TODO: write this doc
ui/.env+1−1
@@ -1,3 +1,3 @@
1VITE_SHIP_URL=http://localhost:8081
1VITE_SHIP_URL=http://localhost:8081
2ASTROLABE_DESK=~/urbit/zod/astrolabe
2ASTROLABE_DESK=~/urbit/zod/astrolabe
3−GLOBBER_DESK=~/urbit/zod/globber
3+GLOBBER_DESK=~/urbit/zod/globber
ui/src/actions/sigma.tsdeleted−73
@@ -1,73 +0,0 @@
1−import tippy from 'tippy.js';
2−// import DocLink from '@/docs/DocLink.svelte'; // TODO try to add a link in the tooltip somehow or something, like:
3−// const app = new DocLink({
4−// target: document.getElementBySelector('.tippy')
5−// })
6−
7−const defaultParams = {
8− theme: 'astrolabe',
9− delay: [500, 0],
10−};
11−
12−function getParams(paramsOrContent:any = {}, overrides = {}) {
13− let params = paramsOrContent;
14− if (typeof paramsOrContent === 'string') {
15− params = { content: paramsOrContent };
16− }
17− return {
18− ...defaultParams,
19− ...params,
20− ...overrides,
21− };
22−}
23−
24−export default function tooltip(node, paramsOrContent: any = {}) {
25− const onTrigger = () => {
26− console.log('triggered');
27− node.dispatchEvent(new CustomEvent("tooltipTriggered"));
28− };
29− const onUntrigger = () => {
30− console.log('untriggered');
31− node.dispatchEvent(new CustomEvent("tooltipUntriggered"));
32− };
33− const onClickOutside = (_, e) => {
34− e.stopPropagation();
35− };
36− const listeners = {
37− onTrigger,
38− onUntrigger,
39− onClickOutside,
40− }
41−
42− const params = getParams(paramsOrContent, listeners);
43− const { content } = params;
44−
45− // Let's make sure the "aria-label" attribute
46− // is set so our element is accessible:
47− // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute
48− if (!node.getAttribute("aria-label")) node.setAttribute("aria-label", content);
49−
50−
51− // Support any of the Tippy props by forwarding all "params":
52− // https://atomiks.github.io/tippyjs/v6/all-props/
53− const tip: any = tippy(node, params);
54− const hideTip = (e) => {
55− if (tip.state.isShown) {
56− tip.hide();
57− // e.stopPropagation();
58− }
59− }
60− node.addEventListener('click', hideTip);
61−
62−
63− return {
64− // If the props change, let's update the Tippy instance:
65− update: (newParams) => tip.setProps(getParams(newParams)),
66−
67− // Clean up the Tippy instance on unmount:
68− destroy: () => {
69− node.removeEventListener('click', hideTip);
70− tip.destroy();
71− }
72− };
73−};
ui/src/actions/symbolPartClick.ts+1−11
@@ -1,6 +1,3 @@
1−const docLinkRegex = /\/~\/scry\/docs\/usr\/astrolabe\/([-~._\w\d]+).html/;
2−
3−
4function listenOnSvgElements(node, onPathChange) {
1function listenOnSvgElements(node, onPathChange) {
5 const parts = node.querySelectorAll('path, circle, line');
2 const parts = node.querySelectorAll('path, circle, line');
6 for (let part of parts) {
3 for (let part of parts) {
@@ -15,13 +12,6 @@ function listenOnSvgElements(node, onPathChange) {
15 }
12 }
16}
13}
17
14
18−// function docLinks(node, onPathChange: Function) {
19−// convertDocLinks(node, onPathChange)
20−// return {
21−// update: (onPathChange) => convertDocLinks(node, onPathChange),
22−// };
23−// };
24−
25export default function svgClick(node: HTMLElement, { onPartClick, enabled = true, svgString }) {
15export default function svgClick(node: HTMLElement, { onPartClick, enabled = true, svgString }) {
26 if (enabled) listenOnSvgElements(node, onPartClick);
16 if (enabled) listenOnSvgElements(node, onPartClick);
27
17
@@ -34,4 +24,4 @@ export default function svgClick(node: HTMLElement, { onPartClick, enabled = tru
34 }
24 }
35 },
25 },
36 };
26 };
37−}
27+}
ui/src/components/search/SearchResults.svelte+2−10
@@ -12,7 +12,7 @@
12 export let sigilQuery: SigilQuery;
12 export let sigilQuery: SigilQuery;
13 export let patpSearch: string;
13 export let patpSearch: string;
14 export let searchMode: ('patp' | 'sigil') = 'patp';
14 export let searchMode: ('patp' | 'sigil') = 'patp';
15− // export let patp: string;
15+
16 let combinedSearchResults = [];
16 let combinedSearchResults = [];
17 let searchedPointsP: Promise<any>;
17 let searchedPointsP: Promise<any>;
18 let searchedPoints: Patp[] = [];
18 let searchedPoints: Patp[] = [];
@@ -35,15 +35,7 @@
35 }
35 }
36 }, 1000);
36 }, 1000);
37 }
37 }
38− // let otherTimer;
38+
39− // $: {
40− // clearTimeout(otherTimer);
41− // if (searchMode === 'sigil') {
42− // otherTimer = setTimeout(() => {
43− // searchedContacts.patpSearch(regexQuery, searchMode);
44− // }, 1000);
45− // }
46− // }
47 function doSearch() {
39 function doSearch() {
48 const searchSnap = search;
40 const searchSnap = search;
49 searchStatus = 'prog';
41 searchStatus = 'prog';
ui/src/components/search/sigil/ClanSelect.svelte−5
@@ -4,11 +4,6 @@
4 import { capitalize } from 'lib/utils';
4 import { capitalize } from 'lib/utils';
5 import { CLANS, Clan } from 'types/sigil';
5 import { CLANS, Clan } from 'types/sigil';
6
6
7− // const CLANS = ['galaxy', 'star', 'planet'] as const;
8− // const ClanTuple = typeof CLANS;
9− // type Clan = typeof ClanTuple[number];
10−
11− export let sigilSearch = {};
12 export let clan: Clan = 'planet';
7 export let clan: Clan = 'planet';
13
8
14 let dropdownOpen = false;
9 let dropdownOpen = false;
ui/src/components/search/sigil/SigilInput.svelte+1−5
@@ -8,15 +8,11 @@
8 import type { SigilQuery } from 'lib/sigil';
8 import type { SigilQuery } from 'lib/sigil';
9 import { searchSettings } from 'stores/searchStores';
9 import { searchSettings } from 'stores/searchStores';
10 import { toggleStoreKey } from 'lib/utils';
10 import { toggleStoreKey } from 'lib/utils';
11−import { sigil } from '@tlon/sigil-js';
12
11
13 export let sigilQuery: SigilQuery;
12 export let sigilQuery: SigilQuery;
14− // export let clan: ('galaxy' | 'star' | 'planet') = 'planet';
15 let focusedSymbolIndex: number = undefined;
13 let focusedSymbolIndex: number = undefined;
16 let inputComponents: string[] = [];
14 let inputComponents: string[] = [];
17
15
18− // let symbols: SymbolQuery = [];
19−
20 $: gridClasses = (sigilQuery.clan === 'galaxy' ? 'max-w-[10rem] grid items-center' : 'max-w-[18rem] grid grid-cols-2 items-center');
16 $: gridClasses = (sigilQuery.clan === 'galaxy' ? 'max-w-[10rem] grid items-center' : 'max-w-[18rem] grid grid-cols-2 items-center');
21
17
22 function unfocusSymbol() {
18 function unfocusSymbol() {
@@ -43,7 +39,7 @@ import { sigil } from '@tlon/sigil-js';
43 }
39 }
44</script>
40</script>
45
41
46−<div class="">
42+<div>
47 <ClanSelect bind:clan={sigilQuery.clan} />
43 <ClanSelect bind:clan={sigilQuery.clan} />
48 <div class="flex flex-col xs:flex-row">
44 <div class="flex flex-col xs:flex-row">
49 <div class="grow-[2] w-full xs:m-0 xs:max-w-[18rem]" on:click={unfocusSymbol}>
45 <div class="grow-[2] w-full xs:m-0 xs:max-w-[18rem]" on:click={unfocusSymbol}>
ui/src/components/search/sigil/SymbolInput.svelte−5
@@ -3,13 +3,10 @@
3 import without from 'lodash/without';
3 import without from 'lodash/without';
4
4
5 import { searchSettings } from 'stores/searchStores';
5 import { searchSettings } from 'stores/searchStores';
6− import type { PartType } from 'types/sigil';
7 import type { SymbolQuery } from 'lib/sigil';
6 import type { SymbolQuery } from 'lib/sigil';
8 import { filterPartsByGeon } from 'lib/sigil';
7 import { filterPartsByGeon } from 'lib/sigil';
9− import * as colors from 'lib/colors';
10
8
11 export let symbolQuery: SymbolQuery;
9 export let symbolQuery: SymbolQuery;
12− // export let inputMode: PartType;
13 export let focusedSymbolIndex: number;
10 export let focusedSymbolIndex: number;
14 export let index: number = 0;
11 export let index: number = 0;
15 export let clan: string = 'galaxy';
12 export let clan: string = 'galaxy';
@@ -44,7 +41,6 @@
44 focused ? `${scaleClass} z-10`
41 focused ? `${scaleClass} z-10`
45 : (focusedSymbolIndex !== undefined ? 'scale-50' : '' )
42 : (focusedSymbolIndex !== undefined ? 'scale-50' : '' )
46 );
43 );
47− // $: focusedClasses = focused ? `border border-gold-s1 border-2` : '';
48
44
49 function onPartDelete({ detail: partId }) {
45 function onPartDelete({ detail: partId }) {
50 symbolQuery = symbolQuery.removePart(partId);
46 symbolQuery = symbolQuery.removePart(partId);
@@ -76,7 +72,6 @@
76 style:max-width="{size}px"
72 style:max-width="{size}px"
77 on:click|stopPropagation
73 on:click|stopPropagation
78>
74>
79−<!-- fgColor={!plausible ? 'red' : (symbolQuery.isPerfectMatch ? colors.GOLDS1 : 'black')} -->
80 {#if symbolQuery.components.length > 0}
75 {#if symbolQuery.components.length > 0}
81 <Symbol components={symbolQuery.components} {size}
76 <Symbol components={symbolQuery.components} {size}
82 inverted={!symbolQuery.geon}
77 inverted={!symbolQuery.geon}
ui/src/lib/sigil.ts+9−4
@@ -110,13 +110,18 @@ export class SigilQuery {
110 default:
110 default:
111 return;
111 return;
112 }
112 }
113+ let symbols;
113 try {
114 try {
114− this.symbols = queryParts.map((parts) => {
115+ symbols = queryParts.map((parts) => {
115− return new SymbolQuery(this, parts);
116+ let symbol = new SymbolQuery(this, parts);
117+ if (symbol.components.length !== parts.length) {
118+ throw new Error(`Invalid component ids: ${without(parts, symbol.components)}`);
119+ }
116 });
120 });
117 } catch (e) {
121 } catch (e) {
118 console.error("Couldn't load in sigil query text", e);
122 console.error("Couldn't load in sigil query text", e);
123+ this.clan = 'planet';
119− this.symbols = [];
124+ symbols = [];
120 }
125 }
121 this.padSymbols();
126 this.padSymbols();
122 }
127 }
@@ -248,7 +253,7 @@ export function filterPartsByGeon(parts: string[], geon: Geon): string[] {
248
253
249export function filterFakeParts(parts: string[], symbolType: SymbolType): string[] {
254export function filterFakeParts(parts: string[], symbolType: SymbolType): string[] {
250 let plausibleSyllables = getSyllablesBySymbolType(symbolType);
255 let plausibleSyllables = getSyllablesBySymbolType(symbolType);
251− return parts.filter(part => !plausibleSyllables.includes(part));
256+ return parts.filter(part => plausibleSyllables.includes(part));
252}
257}
253
258
254export class SymbolQuery {
259export class SymbolQuery {
ui/src/stores/docs.ts−1
@@ -2,7 +2,6 @@ import { writable } from 'svelte/store';
2
2
3import { getDoc } from 'lib/api';
3import { getDoc } from 'lib/api';
4const docs = {};
4const docs = {};
5−// import type { AppState, Contacts } from 'types/store';
6
5
7const initStore: any = {
6const initStore: any = {
8 show: false,
7 show: false,
ui/src/stores/store.ts+1−1
@@ -48,4 +48,4 @@ getPeers().then(({ points }) => {
48 setStoreKey(store, 'peers', points.map(normalizeId));
48 setStoreKey(store, 'peers', points.map(normalizeId));
49});
49});
50
50
51−export default { subscribe, set, searchPatp, searchSigil, reset };
51+export default { subscribe, set, searchPatp, searchSigil, reset };
ui/src/styles/tailwind-output.css+3
@@ -1721,6 +1721,9 @@ Ensure the default browser behavior of the `hidden` attribute.
1721.hover\:opacity-80:hover {
1721.hover\:opacity-80:hover {
1722 opacity: 0.8;
1722 opacity: 0.8;
1723}
1723}
1724+.hover\:opacity-40:hover {
1725+ opacity: 0.4;
1726+}
1724@media (min-width: 360px) {
1727@media (min-width: 360px) {
1725
1728
1726 .\32xs\:-bottom-3\.5 {
1729 .\32xs\:-bottom-3\.5 {