Skip to content

Commit 83e6c2b

Browse files
committed
chore: clean up crisp & intercom
1 parent 2fdc13a commit 83e6c2b

File tree

8 files changed

+358
-218
lines changed

8 files changed

+358
-218
lines changed

docs/components/content/CrispDemo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const isLoaded = ref(false)
55
<template>
66
<div class="not-prose">
77
<div class="flex items-center justify-center p-5">
8-
<ScriptCrisp id="b1021910-7ace-425a-9ef5-07f49e5ce417" class="crisp">
8+
<ScriptCrisp id="b1021910-7ace-425a-9ef5-07f49e5ce417" class="crisp" @ready="isLoaded = true">
99
<template #awaitingLoad>
1010
<div class="crisp-icon" />
1111
</template>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<script setup lang="ts">
2+
const isLoaded = ref(false)
3+
</script>
4+
5+
<template>
6+
<div style="padding: 40px; position: relative;">
7+
<ScriptIntercom @ready="isLoaded = true" app-id="akg5rmxb" api-base="https://api-iam.intercom.io" alignment="left" :horizontal-padding="0" class="intercom">
8+
<div style="display: flex; align-items: center; justify-content: center; width: 48px; height: 48px;">
9+
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 28 32"><path d="M28 32s-4.714-1.855-8.527-3.34H3.437C1.54 28.66 0 27.026 0 25.013V3.644C0 1.633 1.54 0 3.437 0h21.125c1.898 0 3.437 1.632 3.437 3.645v18.404H28V32zm-4.139-11.982a.88.88 0 00-1.292-.105c-.03.026-3.015 2.681-8.57 2.681-5.486 0-8.517-2.636-8.571-2.684a.88.88 0 00-1.29.107 1.01 1.01 0 00-.219.708.992.992 0 00.318.664c.142.128 3.537 3.15 9.762 3.15 6.226 0 9.621-3.022 9.763-3.15a.992.992 0 00.317-.664 1.01 1.01 0 00-.218-.707z" /></svg>
10+
</div>
11+
</ScriptIntercom>
12+
<div class="text-center">
13+
<UAlert v-if="!isLoaded" class="mb-5" size="sm" color="blue" variant="soft" title="Click to load" description="Clicking the button to the right will load the Intercom script" />
14+
<UAlert v-else color="green" variant="soft" title="Crisp is loaded" description="The Intercom Facade component is no longer being displayed." />
15+
</div>
16+
</div>
17+
</template>
18+
19+
<style>
20+
.intercom {
21+
position: relative; /* change to fixed */
22+
z-index: 100000;
23+
width: 48px;
24+
align-items: center;
25+
justify-content: center;
26+
height: 48px;
27+
border-radius: 50%;
28+
cursor: pointer;
29+
background-color: #0071b2;
30+
filter: drop-shadow(rgba(0, 0, 0, 0.06) 0px 1px 6px) drop-shadow(rgba(0, 0, 0, 0.16) 0px 2px 32px);
31+
}
32+
</style>

docs/content/scripts/marketing/intercom.md

Lines changed: 0 additions & 182 deletions
This file was deleted.

docs/content/scripts/support/crisp.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ links:
1414

1515
[Crisp](https://crisp.chat/) is a customer messaging platform that lets you communicate with your customers through chat, email, and more.
1616

17-
Nuxt Scripts provides a [useScriptCrisp](#usescriptcrisp) composable and a headless Facade Component [useScriptCrisp](#scriptcrisp) component to interact with the Crisp.
17+
Nuxt Scripts provides a [useScriptCrisp](#usescriptcrisp) composable and a headless Facade Component [useScriptCrisp](#scriptcrisp) component to interact with crisp.
1818

1919
## ScriptCrisp
2020

2121
The `ScriptCrisp` component is headless Facade Component wrapping the [useScriptCrisp](#usescriptcrisp) composable, providing a simple, performance optimized way to load Crisp in your Nuxt app.
2222

23-
It's optimized for performance by leveraging the [Element Event Triggers](/docs/guides/script-triggers#element-event-triggers), only loading the Crisp when specific elements events happen.
23+
It's optimized for performance by leveraging the [Element Event Triggers](/docs/guides/script-triggers#element-event-triggers), only loading crisp when specific elements events happen.
2424

2525
By default, it will load on the `click` DOM event.
2626

@@ -48,7 +48,7 @@ const isLoaded = ref(false)
4848
</ScriptCrisp>
4949
</div>
5050
<div class="text-center">
51-
<UAlert v-if="!isLoaded" class="mb-5" size="sm" color="blue" variant="soft" title="Click to load" description="Clicking the button to the right will load the Crisp script" />
51+
<UAlert v-if="!isLoaded" class="mb-5" size="sm" color="blue" variant="soft" title="Click to load" description="Clicking the button to the right will load crisp script" />
5252
<UAlert v-else color="green" variant="soft" title="Crisp is loaded" description="The Crisp Facade component is no longer being displayed." />
5353
</div>
5454
</div>
@@ -91,18 +91,18 @@ const isLoaded = ref(false)
9191

9292
### Props
9393

94-
- `trigger`: The trigger event to load the Crisp. Default is `click`. See [Element Event Triggers](/docs/guides/script-triggers#element-event-triggers) for more information.
95-
- `id`: The Crisp ID.
94+
- `trigger`: The trigger event to load crisp. Default is `click`. See [Element Event Triggers](/docs/guides/script-triggers#element-event-triggers) for more information.
95+
- `id`: Crisp ID.
9696
- `runtimeConfig`: Extra configuration options. Used to configure the locale. Same as CRISP_RUNTIME_CONFIG.
9797
- `tokenId`: Associated a session, equivalent to using CRISP_TOKEN_ID variable. Same as CRISP_TOKEN_ID.
98-
- `cookieDomain`: Restrict the domain that the Crisp cookie is set on. Same as CRISP_COOKIE_DOMAIN.
98+
- `cookieDomain`: Restrict the domain that crisp cookie is set on. Same as CRISP_COOKIE_DOMAIN.
9999
- `cookieExpiry`: The cookie expiry in seconds. Same as CRISP_COOKIE_EXPIRATION.
100100

101101
See the [Config Schema](#config-schema) for full details.
102102

103103
### Events
104104

105-
The `ScriptCrisp` component emits a single `ready` event when the Crisp is loaded.
105+
The `ScriptCrisp` component emits a single `ready` event when crisp is loaded.
106106

107107
```ts
108108
const emits = defineEmits<{
@@ -147,11 +147,11 @@ The component provides minimal UI by default, only enough to be functional and a
147147

148148
The default slot is used to display content that will always be visible.
149149

150-
Tip: It's best to leave this empty as the Crisp replaces this component in its own component.
150+
Tip: It's best to leave this empty as crisp replaces this component in its own component.
151151

152152
**awaitingLoad**
153153

154-
The slot is used to display content while the Crisp is loading.
154+
The slot is used to display content while crisp is loading.
155155

156156
```vue
157157
<template>
@@ -167,7 +167,7 @@ The slot is used to display content while the Crisp is loading.
167167

168168
**loading**
169169

170-
The slot is used to display content while the Crisp is loading.
170+
The slot is used to display content while crisp is loading.
171171

172172
Tip: You should use the `ScriptLoadingIndicator` by default for accessibility and UX.
173173

@@ -185,7 +185,7 @@ Tip: You should use the `ScriptLoadingIndicator` by default for accessibility an
185185

186186
## useScriptCrisp
187187

188-
The `useScriptCrisp` composable lets you have fine-grain control over the Crisp SDK. It provides a way to load the Crisp SDK and interact with it programmatically.
188+
The `useScriptCrisp` composable lets you have fine-grain control over Crisp SDK. It provides a way to load crisp SDK and interact with it programmatically.
189189

190190
```ts
191191
export function useScriptCrisp<T extends CrispApi>(_options?: CrispInput) {}
@@ -198,7 +198,7 @@ Please follow the [Registry Scripts](/docs/guides/registry-scripts) guide to lea
198198
```ts
199199
export const CrispOptions = object({
200200
/**
201-
* The Crisp ID.
201+
* Crisp ID.
202202
*/
203203
id: string(),
204204
/**
@@ -216,7 +216,7 @@ export const CrispOptions = object({
216216
*/
217217
tokenId: optional(string()),
218218
/**
219-
* Restrict the domain that the Crisp cookie is set on.
219+
* Restrict the domain that crisp cookie is set on.
220220
* Same as CRISP_COOKIE_DOMAIN.
221221
* @see https://docs.crisp.chat/guides/chatbox-sdks/web-sdk/cookie-policies/
222222
*/

0 commit comments

Comments
 (0)