@picked/svelte 0.0.59-next.1 → 0.0.60-next.1

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.
@@ -25,6 +25,7 @@
25
25
  const client = getPicked()
26
26
 
27
27
  const dashboardProjectUrl = `${client.dashboardUrl}/p/${client.projectId}`
28
+ const isPreview = Boolean(client.searchParams['preview-token']?.[0])
28
29
 
29
30
  const tabs = [
30
31
  {
@@ -122,14 +123,19 @@
122
123
  </div>
123
124
  </div>
124
125
  {:else}
125
- <button
126
- class="floating-button"
127
- onclick={() => experience.open()}
128
- aria-label="Open Picked Devtools"
129
- title="Open Picked Devtools"
130
- >
131
- <PickedIcon height={25} width={25}/>
132
- </button>
126
+ <div class="launcher">
127
+ {#if isPreview}
128
+ <span class="preview-tag" role="status" aria-live="polite">Preview mode</span>
129
+ {/if}
130
+ <button
131
+ class="floating-button"
132
+ onclick={() => experience.open()}
133
+ aria-label="Open Picked Devtools"
134
+ title="Open Picked Devtools"
135
+ >
136
+ <PickedIcon height={25} width={25}/>
137
+ </button>
138
+ </div>
133
139
  {/if}
134
140
 
135
141
  <style>
@@ -307,16 +313,21 @@
307
313
  padding-right: var(--space-4);
308
314
  }
309
315
 
310
- .floating-button {
316
+ .launcher {
311
317
  position: fixed;
312
318
  bottom: 1rem;
313
319
  right: 1.5rem;
314
- border-radius: 6px;
315
- background-color: var(--color-white);
320
+ z-index: 999999;
321
+ display: flex;
322
+ align-items: stretch;
323
+ }
324
+
325
+ .floating-button {
326
+ border-radius: 0 6px 6px 0;
327
+ background-color: #ffffff;
316
328
  display: grid;
317
329
  place-items: center;
318
330
  cursor: pointer;
319
- z-index: 999999;
320
331
  border: 0 transparent;
321
332
  padding: 6px;
322
333
  box-shadow: 2px 2px 4px #00000029;
@@ -326,6 +337,21 @@
326
337
  }
327
338
  }
328
339
 
340
+ .preview-tag {
341
+ display: flex;
342
+ align-items: center;
343
+ padding: 0 10px;
344
+ background: #2563eb;
345
+ color: #ffffff;
346
+ border-radius: 6px 0 0 6px;
347
+ font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
348
+ 'Helvetica Neue', Arial, sans-serif;
349
+ font-size: 12px;
350
+ font-weight: 500;
351
+ line-height: 1.4;
352
+ box-shadow: 2px 2px 4px #00000029;
353
+ }
354
+
329
355
  /** Compact inline form elements for use within table cells */
330
356
  .devtools :global(.inline-select),
331
357
  .devtools :global(.inline-input) {
@@ -2,7 +2,9 @@ import { Plugin } from '@picked/client';
2
2
  export interface SvelteDevtoolsPluginOptions {
3
3
  /**
4
4
  * When `true`, the devtools experience launches automatically on page load.
5
- * When `false`, devtools can only be opened via the Picked Chrome extension.
5
+ * When `false`, devtools can only be opened via the Picked Chrome extension,
6
+ * **unless** a preview token is present — in which case the launcher always
7
+ * mounts so the previewed site remains inspectable in production builds.
6
8
  *
7
9
  * @default false
8
10
  */
@@ -12,8 +14,8 @@ export interface SvelteDevtoolsPluginOptions {
12
14
  * Registers the devtools experience for on-demand loading via the Chrome DevTools extension.
13
15
  * The devtools component is lazily loaded — it is never included in the initial bundle.
14
16
  *
15
- * @param options - Optional configuration for the devtools plugin.
16
- * @returns An array of plugins to register with the Picked client.
17
+ * @param {SvelteDevtoolsPluginOptions} [options] - Optional configuration for the devtools plugin.
18
+ * @returns {Plugin[]} An array of plugins to register with the Picked client.
17
19
  * @example
18
20
  * ```typescript
19
21
  * const client = new Picked({
@@ -1 +1 @@
1
- import{adaptSvelteComponent as e}from"../../component.js";import{__vitePreload as t}from"../../_virtual/_vite/preload-helper.js";import{lazyComponent as n}from"@picked/client";import{createExperience as r,createExperiencePlugin as i}from"@picked/client/plugins/create-experience";var a=a=>{let o=r({id:`devtools`,key:`devtools`,name:`Picked Devtools`,condition:!1,initializeOpen:!1,targets:[{selector:`body`,placement:`append`}],component:e(n(()=>t(()=>import(`./DevToolsExperience.svelte`),[])))});return o.addStep({name:`Tools`}),[{name:`svelte-devtools`,setup:e=>{a?.enabled&&e.eventBus.watch(t=>{t.type===`ready`&&e.experiences.launch({key:o.key,options:{bypassCondition:!0}})})}},i({experiences:[o]})]};export{a as svelteDevtoolsPlugin};
1
+ import{adaptSvelteComponent as e}from"../../component.js";import{__vitePreload as t}from"../../_virtual/_vite/preload-helper.js";import{lazyComponent as n}from"@picked/client";import{createExperience as r,createExperiencePlugin as i}from"@picked/client/plugins/create-experience";var a=a=>{let o=r({id:`devtools`,key:`devtools`,name:`Picked Devtools`,condition:!1,initializeOpen:!1,targets:[{selector:`body`,placement:`append`}],component:e(n(()=>t(()=>import(`./DevToolsExperience.svelte`),[])))});return o.addStep({name:`Tools`}),[{name:`svelte-devtools`,setup:e=>{let t=!!e.searchParams[`preview-token`]?.[0];!a?.enabled&&!t||e.eventBus.watch(t=>{t.type===`ready`&&e.experiences.launch({key:o.key,options:{bypassCondition:!0}})})}},i({experiences:[o]})]};export{a as svelteDevtoolsPlugin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picked/svelte",
3
- "version": "0.0.59-next.1",
3
+ "version": "0.0.60-next.1",
4
4
  "dependencies": {
5
5
  "d3": "^7.9.0"
6
6
  },
@@ -88,7 +88,7 @@
88
88
  },
89
89
  "module": "./dist/index.js",
90
90
  "peerDependencies": {
91
- "@picked/client": "0.0.59-next.1",
91
+ "@picked/client": "0.0.60-next.1",
92
92
  "effector": "^23.3.0",
93
93
  "svelte": "^5.46.4"
94
94
  },