@hyvor/design 2.0.18 → 2.1.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/cloud/CloudContext/CloudContext.svelte +0 -9
- package/dist/cloud/CloudContext/cloudContextState.svelte.d.ts +7 -0
- package/dist/components/Callout/Callout.svelte +2 -1
- package/dist/components/ColorPicker/ColorPicker.svelte.d.ts +1 -1
- package/dist/components/Loader/Loader.svelte.d.ts +1 -1
- package/dist/marketing/Docs/Docs.svelte +371 -15
- package/dist/marketing/Docs/Docs.svelte.d.ts +5 -2
- package/dist/marketing/Docs/{Content/DocsImage.svelte → DocsImage.svelte} +1 -1
- package/dist/marketing/Docs/NavItem.svelte +96 -0
- package/dist/marketing/Docs/{Nav/NavItem.svelte.d.ts → NavItem.svelte.d.ts} +5 -2
- package/dist/marketing/Docs/OpenApi/OpenApi.svelte +144 -0
- package/dist/marketing/Docs/OpenApi/OpenApi.svelte.d.ts +7 -0
- package/dist/marketing/Docs/OpenApi/Operation.svelte +147 -0
- package/dist/marketing/Docs/OpenApi/Operation.svelte.d.ts +9 -0
- package/dist/marketing/Docs/OpenApi/ParamsTable.svelte +57 -0
- package/dist/marketing/Docs/OpenApi/ParamsTable.svelte.d.ts +8 -0
- package/dist/marketing/Docs/OpenApi/SchemaFields.svelte +141 -0
- package/dist/marketing/Docs/OpenApi/SchemaFields.svelte.d.ts +9 -0
- package/dist/marketing/Docs/OpenApi/openapi.d.ts +106 -0
- package/dist/marketing/Docs/OpenApi/openapi.js +267 -0
- package/dist/marketing/Docs/Sidebar/Sidebar.svelte +1 -3
- package/dist/marketing/Docs/fulldocs.d.ts +17 -0
- package/dist/marketing/Docs/fulldocs.js +106 -0
- package/dist/marketing/Docs/types.d.ts +23 -0
- package/dist/marketing/Docs/types.js +1 -0
- package/dist/marketing/index.d.ts +3 -6
- package/dist/marketing/index.js +2 -6
- package/package.json +2 -3
- package/dist/marketing/Docs/Content/Content.svelte +0 -181
- package/dist/marketing/Docs/Content/Content.svelte.d.ts +0 -6
- package/dist/marketing/Docs/Nav/Nav.svelte +0 -156
- package/dist/marketing/Docs/Nav/Nav.svelte.d.ts +0 -6
- package/dist/marketing/Docs/Nav/NavCategory.svelte +0 -49
- package/dist/marketing/Docs/Nav/NavCategory.svelte.d.ts +0 -9
- package/dist/marketing/Docs/Nav/NavItem.svelte +0 -39
- package/dist/marketing/track/track.d.ts +0 -22
- package/dist/marketing/track/track.js +0 -70
- /package/dist/marketing/Docs/{Content/DocsImage.svelte.d.ts → DocsImage.svelte.d.ts} +0 -0
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { afterNavigate } from '$app/navigation';
|
|
3
|
-
import IconList from '@hyvor/icons/IconList';
|
|
4
|
-
import { onMount } from 'svelte';
|
|
5
|
-
import { clickOutside } from '../../../components/index.js';
|
|
6
|
-
interface Props {
|
|
7
|
-
children?: import('svelte').Snippet;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
let { children }: Props = $props();
|
|
11
|
-
|
|
12
|
-
let navEl: HTMLElement | undefined = $state();
|
|
13
|
-
|
|
14
|
-
interface Active {
|
|
15
|
-
name: string;
|
|
16
|
-
category: string | null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
let active: Active | null = $state(null);
|
|
20
|
-
|
|
21
|
-
function setActive() {
|
|
22
|
-
const activeEl = navEl?.querySelector('a.active');
|
|
23
|
-
|
|
24
|
-
if (!activeEl || !(activeEl instanceof HTMLElement)) {
|
|
25
|
-
active = null;
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const category =
|
|
30
|
-
(activeEl.closest('.nav-category')?.querySelector('.name') as HTMLElement)?.innerText || null;
|
|
31
|
-
|
|
32
|
-
active = {
|
|
33
|
-
name: activeEl.innerText,
|
|
34
|
-
category
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
onMount(() => {
|
|
39
|
-
setActive();
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
afterNavigate(() => {
|
|
43
|
-
setActive();
|
|
44
|
-
hideNavOnMobile();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
let mobileNavShown = false;
|
|
48
|
-
|
|
49
|
-
function handleMobileClick(e: any) {
|
|
50
|
-
e.stopPropagation();
|
|
51
|
-
if (!navEl) return;
|
|
52
|
-
if (navEl.style.display !== 'block') {
|
|
53
|
-
navEl.style.display = 'block';
|
|
54
|
-
mobileNavShown = true;
|
|
55
|
-
} else {
|
|
56
|
-
navEl.style.display = 'none';
|
|
57
|
-
mobileNavShown = false;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function handleNavOutsideClick() {
|
|
62
|
-
if (!navEl) return;
|
|
63
|
-
if (mobileNavShown) {
|
|
64
|
-
navEl.style.display = 'none';
|
|
65
|
-
mobileNavShown = false;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function hideNavOnMobile() {
|
|
70
|
-
if (!navEl) return;
|
|
71
|
-
if (window.innerWidth < 992) {
|
|
72
|
-
navEl.style.display = 'none';
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
</script>
|
|
76
|
-
|
|
77
|
-
<div class="docs-nav">
|
|
78
|
-
{#if active}
|
|
79
|
-
<button class="mobile hds-box" onclick={handleMobileClick}>
|
|
80
|
-
<div class="left">
|
|
81
|
-
{#if active.category}
|
|
82
|
-
<span class="category">{active.category}</span> »
|
|
83
|
-
{/if}
|
|
84
|
-
<span class="name">{active.name}</span>
|
|
85
|
-
</div>
|
|
86
|
-
<IconList size={18} />
|
|
87
|
-
</button>
|
|
88
|
-
{/if}
|
|
89
|
-
|
|
90
|
-
<nav
|
|
91
|
-
class="hds-box nav-inner"
|
|
92
|
-
bind:this={navEl}
|
|
93
|
-
use:clickOutside={{
|
|
94
|
-
callback: handleNavOutsideClick
|
|
95
|
-
}}
|
|
96
|
-
>
|
|
97
|
-
{@render children?.()}
|
|
98
|
-
</nav>
|
|
99
|
-
</div>
|
|
100
|
-
|
|
101
|
-
<style>.docs-nav {
|
|
102
|
-
width: 220px;
|
|
103
|
-
top: var(--header-height, 0);
|
|
104
|
-
padding: 25px 0;
|
|
105
|
-
position: sticky;
|
|
106
|
-
flex-shrink: 0;
|
|
107
|
-
align-self: flex-start;
|
|
108
|
-
max-height: calc(100vh - var(--header-height));
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
nav {
|
|
112
|
-
padding: 15px 0;
|
|
113
|
-
overflow-y: auto;
|
|
114
|
-
max-height: calc(100vh - var(--header-height) - 50px);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.mobile {
|
|
118
|
-
display: none;
|
|
119
|
-
padding: 10px 20px;
|
|
120
|
-
cursor: pointer;
|
|
121
|
-
}
|
|
122
|
-
.mobile:hover {
|
|
123
|
-
background-color: var(--hover);
|
|
124
|
-
}
|
|
125
|
-
.mobile .left {
|
|
126
|
-
flex: 1;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
@media (max-width: 992px) {
|
|
130
|
-
.mobile {
|
|
131
|
-
display: flex;
|
|
132
|
-
width: 100%;
|
|
133
|
-
text-align: left;
|
|
134
|
-
}
|
|
135
|
-
.nav-inner {
|
|
136
|
-
display: none;
|
|
137
|
-
}
|
|
138
|
-
.docs-nav {
|
|
139
|
-
width: 100%;
|
|
140
|
-
position: relative;
|
|
141
|
-
top: 0;
|
|
142
|
-
padding: 0 15px;
|
|
143
|
-
margin: 20px 0;
|
|
144
|
-
max-height: initial;
|
|
145
|
-
order: 1;
|
|
146
|
-
}
|
|
147
|
-
nav {
|
|
148
|
-
padding: 0;
|
|
149
|
-
max-height: initial;
|
|
150
|
-
position: absolute;
|
|
151
|
-
width: calc(100% - 30px);
|
|
152
|
-
margin-top: 10px;
|
|
153
|
-
max-height: 500px;
|
|
154
|
-
z-index: 100;
|
|
155
|
-
}
|
|
156
|
-
}</style>
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { ComponentType } from 'svelte';
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
name: string;
|
|
6
|
-
start?: import('svelte').Snippet;
|
|
7
|
-
end?: import('svelte').Snippet;
|
|
8
|
-
children?: import('svelte').Snippet;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
let { name, start, end, children }: Props = $props();
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<div class="nav-category">
|
|
15
|
-
<div class="name">
|
|
16
|
-
<span class="button-content">
|
|
17
|
-
{#if start}
|
|
18
|
-
<span class="slot start">{@render start?.()}</span>
|
|
19
|
-
{/if}
|
|
20
|
-
|
|
21
|
-
{#if end}
|
|
22
|
-
<span class="slot end">{@render end?.()}</span>
|
|
23
|
-
{/if}
|
|
24
|
-
</span>
|
|
25
|
-
{name}
|
|
26
|
-
</div>
|
|
27
|
-
<div class="nav-items">
|
|
28
|
-
{@render children?.()}
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<style>
|
|
33
|
-
.nav-category {
|
|
34
|
-
margin-bottom: 20px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.name {
|
|
38
|
-
font-weight: 600;
|
|
39
|
-
padding: 10px 25px;
|
|
40
|
-
display: flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.slot.start {
|
|
45
|
-
margin-right: 5px;
|
|
46
|
-
margin-left: 0;
|
|
47
|
-
display: flex;
|
|
48
|
-
}
|
|
49
|
-
</style>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
name: string;
|
|
3
|
-
start?: import('svelte').Snippet;
|
|
4
|
-
end?: import('svelte').Snippet;
|
|
5
|
-
children?: import('svelte').Snippet;
|
|
6
|
-
}
|
|
7
|
-
declare const NavCategory: import("svelte").Component<Props, {}, "">;
|
|
8
|
-
type NavCategory = ReturnType<typeof NavCategory>;
|
|
9
|
-
export default NavCategory;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { page } from '$app/stores';
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
href: string;
|
|
6
|
-
children?: import('svelte').Snippet;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
let { href, children, ...rest }: Props = $props();
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<a
|
|
13
|
-
{href}
|
|
14
|
-
{...rest}
|
|
15
|
-
class:active={href === $page.url.pathname}
|
|
16
|
-
aria-current={href === $page.url.pathname ? 'page' : undefined}
|
|
17
|
-
>
|
|
18
|
-
{@render children?.()}
|
|
19
|
-
</a>
|
|
20
|
-
|
|
21
|
-
<style>
|
|
22
|
-
a {
|
|
23
|
-
display: block;
|
|
24
|
-
padding: 4px 25px;
|
|
25
|
-
color: var(--text-light);
|
|
26
|
-
font-size: 14px;
|
|
27
|
-
letter-spacing: 0.3px;
|
|
28
|
-
border-left: 3px solid transparent;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
a:hover {
|
|
32
|
-
background-color: var(--hover);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
a.active {
|
|
36
|
-
background-color: var(--accent-lightest);
|
|
37
|
-
border-left: 3px solid var(--accent);
|
|
38
|
-
}
|
|
39
|
-
</style>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
interface InitOptions {
|
|
2
|
-
forceTrack?: boolean;
|
|
3
|
-
openPanelApiUrl?: string;
|
|
4
|
-
openPanelClientId?: string;
|
|
5
|
-
context?: Record<string, any>;
|
|
6
|
-
}
|
|
7
|
-
declare class Track {
|
|
8
|
-
private op;
|
|
9
|
-
init({ forceTrack, openPanelApiUrl, openPanelClientId, context }?: InitOptions): void;
|
|
10
|
-
ready(): boolean;
|
|
11
|
-
private warnNoOp;
|
|
12
|
-
context(properties: Record<string, any>): void;
|
|
13
|
-
event(name: string, properties?: Record<string, any>): void;
|
|
14
|
-
identify(profileId: string, props: {
|
|
15
|
-
name?: string;
|
|
16
|
-
avatar?: string;
|
|
17
|
-
properties?: Record<string, any>;
|
|
18
|
-
}): void;
|
|
19
|
-
logout(): void;
|
|
20
|
-
}
|
|
21
|
-
declare const track: Track;
|
|
22
|
-
export default track;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { OpenPanel } from '@openpanel/web';
|
|
2
|
-
import { isCloud } from '../cloud.js';
|
|
3
|
-
class Track {
|
|
4
|
-
op;
|
|
5
|
-
init({ forceTrack = false, openPanelApiUrl = 'https://op.hyvor.com/api', openPanelClientId = 'b11f6143-a6b0-4fa4-a86c-3969c01dbb1d', context = {} } = {}) {
|
|
6
|
-
if (!forceTrack && !isCloud()) {
|
|
7
|
-
console.log('Tracking is disabled in non-production domains.');
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
this.op = new OpenPanel({
|
|
11
|
-
apiUrl: openPanelApiUrl,
|
|
12
|
-
clientId: openPanelClientId,
|
|
13
|
-
trackScreenViews: true,
|
|
14
|
-
trackOutgoingLinks: true,
|
|
15
|
-
trackAttributes: true
|
|
16
|
-
});
|
|
17
|
-
if (Object.keys(context).length > 0) {
|
|
18
|
-
this.op.setGlobalProperties(context);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
ready() {
|
|
22
|
-
return this.op !== undefined;
|
|
23
|
-
}
|
|
24
|
-
warnNoOp(message) {
|
|
25
|
-
console.warn(`[Track] Ignoring action: ${message} - OpenPanel is not initialized. Call track.init() first.`);
|
|
26
|
-
}
|
|
27
|
-
// set global context
|
|
28
|
-
context(properties) {
|
|
29
|
-
if (this.op) {
|
|
30
|
-
this.op.setGlobalProperties(properties);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
this.warnNoOp('set context');
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
// log an event
|
|
37
|
-
event(name, properties) {
|
|
38
|
-
if (this.op) {
|
|
39
|
-
this.op.track(name, properties);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
this.warnNoOp(`log event "${name}"`);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
// identify user
|
|
46
|
-
identify(profileId, props) {
|
|
47
|
-
if (this.op) {
|
|
48
|
-
this.op.identify({
|
|
49
|
-
profileId: profileId,
|
|
50
|
-
firstName: props.name,
|
|
51
|
-
avatar: props.avatar,
|
|
52
|
-
properties: props.properties
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
this.warnNoOp(`identify user "${profileId}"`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
// log out user (clear identity)
|
|
60
|
-
logout() {
|
|
61
|
-
if (this.op) {
|
|
62
|
-
this.op.clear();
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
this.warnNoOp('logout user');
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
const track = new Track();
|
|
70
|
-
export default track;
|
|
File without changes
|