@web-portfolio/icons-sanity 0.1.0 → 1.0.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/index.d.cts CHANGED
@@ -1,16 +1,37 @@
1
1
  import * as sanity from 'sanity';
2
2
  import { StringInputProps } from 'sanity';
3
3
  import * as react from 'react';
4
- import { RegistryEntry } from '@web-portfolio/icons-core';
5
4
 
6
5
  declare const iconRef: {
7
6
  type: "string";
8
7
  name: "iconRef";
9
8
  } & Omit<sanity.StringDefinition, "preview">;
10
9
 
11
- declare function matchesQuery(name: string, entry: RegistryEntry, query: string): boolean;
10
+ /**
11
+ * The shape of one registry entry, redeclared here rather than re-exported
12
+ * from icons-core. icons-core is private and unpublished, so any reference to
13
+ * it that survives into dist/*.d.ts is a type import consumers cannot resolve.
14
+ * Structurally identical to icons-core's `RegistryEntry` — and the picker
15
+ * passes real registry entries to the functions below, so a drift in the
16
+ * fields this actually uses fails typecheck at those call sites.
17
+ */
18
+ interface IconEntry {
19
+ viewBox: string;
20
+ innerHTML: string;
21
+ label: string;
22
+ tags: string[];
23
+ category: string | null;
24
+ }
25
+ declare function matchesQuery(name: string, entry: IconEntry, query: string): boolean;
26
+ /**
27
+ * Alphabetical order alone buries the obvious answer: searching "react" put
28
+ * `react` behind nothing, but searching "go" led with `godot` and `gopher`
29
+ * rather than `go`. Lower score wins; ties fall back to alphabetical.
30
+ */
31
+ declare function rankMatch(name: string, entry: IconEntry, query: string): number;
32
+ declare function formatCategoryLabel(category: string): string;
12
33
  declare function IconPickerInput(props: StringInputProps): react.JSX.Element;
13
34
 
14
35
  declare const sanityIconPicker: sanity.Plugin<void>;
15
36
 
16
- export { IconPickerInput, iconRef, matchesQuery, sanityIconPicker };
37
+ export { type IconEntry, IconPickerInput, formatCategoryLabel, iconRef, matchesQuery, rankMatch, sanityIconPicker };
package/dist/index.d.ts CHANGED
@@ -1,16 +1,37 @@
1
1
  import * as sanity from 'sanity';
2
2
  import { StringInputProps } from 'sanity';
3
3
  import * as react from 'react';
4
- import { RegistryEntry } from '@web-portfolio/icons-core';
5
4
 
6
5
  declare const iconRef: {
7
6
  type: "string";
8
7
  name: "iconRef";
9
8
  } & Omit<sanity.StringDefinition, "preview">;
10
9
 
11
- declare function matchesQuery(name: string, entry: RegistryEntry, query: string): boolean;
10
+ /**
11
+ * The shape of one registry entry, redeclared here rather than re-exported
12
+ * from icons-core. icons-core is private and unpublished, so any reference to
13
+ * it that survives into dist/*.d.ts is a type import consumers cannot resolve.
14
+ * Structurally identical to icons-core's `RegistryEntry` — and the picker
15
+ * passes real registry entries to the functions below, so a drift in the
16
+ * fields this actually uses fails typecheck at those call sites.
17
+ */
18
+ interface IconEntry {
19
+ viewBox: string;
20
+ innerHTML: string;
21
+ label: string;
22
+ tags: string[];
23
+ category: string | null;
24
+ }
25
+ declare function matchesQuery(name: string, entry: IconEntry, query: string): boolean;
26
+ /**
27
+ * Alphabetical order alone buries the obvious answer: searching "react" put
28
+ * `react` behind nothing, but searching "go" led with `godot` and `gopher`
29
+ * rather than `go`. Lower score wins; ties fall back to alphabetical.
30
+ */
31
+ declare function rankMatch(name: string, entry: IconEntry, query: string): number;
32
+ declare function formatCategoryLabel(category: string): string;
12
33
  declare function IconPickerInput(props: StringInputProps): react.JSX.Element;
13
34
 
14
35
  declare const sanityIconPicker: sanity.Plugin<void>;
15
36
 
16
- export { IconPickerInput, iconRef, matchesQuery, sanityIconPicker };
37
+ export { type IconEntry, IconPickerInput, formatCategoryLabel, iconRef, matchesQuery, rankMatch, sanityIconPicker };