forked from open-webui/open-webui
-
Notifications
You must be signed in to change notification settings - Fork 0
Kh agent/vibe dev/pwa instructions #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c1189a8
c/feat(PWA): add pwa banner & install instructions dialog
bromiesTM 0772066
c/chore: add styleguide test pages
bromiesTM 9f8fa32
feat(Dialog): add outside-of-dialog close button
thlehmann-ionos 3289991
refac(Dialog): refactor close action to named function
thlehmann-ionos fe2cedf
c/chore(translations): add missing translation key
bromiesTM 6e99610
c/fix(pwa): dont dismiss on dialog close
bromiesTM d8c2a76
c/fix(PwaDialog): fix external close button location & backdrop
bromiesTM c1e2111
c/refactor(pwa): remove comments without value
bromiesTM a64c455
style(styleguide): make mobile compatible
bromiesTM 349a623
c/feat: move pwa deferredPrompt to store
bromiesTM 084a5e8
style(pwa dialog): improve spacing
bromiesTM de52e0f
refactor(pwa): handle pwa install in manager
bromiesTM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <script lang="ts"> | ||
| export let className = 'size-5'; | ||
| </script> | ||
|
|
||
| <!-- | ||
| Source: Custom | ||
| Copyright: IONOS | ||
| Origin: iOS Share icon for PWA instructions | ||
| --> | ||
|
|
||
| <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" class={className}> | ||
| <path d="M12 2.5L8.5 6L10 7.5L11 6.5V13H13V6.5L14 7.5L15.5 6L12 2.5ZM6 9V19C6 20.1 6.9 21 8 21H16C17.1 21 18 20.1 18 19V9H16V19H8V9H6Z"/> | ||
| </svg> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <script lang="ts"> | ||
| export let className = 'size-5'; | ||
| </script> | ||
|
|
||
| <!-- | ||
| Source: Figma | ||
| Copyright: unknown | ||
| Origin: Figma | ||
| --> | ||
|
|
||
| <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor" class={className}> | ||
| <path d="M3.11246 5.11111C3.11246 2.78311 5.00624 0.888889 7.33468 0.888889C9.66313 0.888889 11.5569 2.78311 11.5569 5.11111C11.5569 5.47956 11.2587 5.77778 10.8902 5.77778C10.5218 5.77778 10.2236 5.47956 10.2236 5.11111C10.2236 3.51822 8.92757 2.22222 7.33468 2.22222C5.74179 2.22222 4.44579 3.51822 4.44579 5.11111C4.44579 5.47956 4.14757 5.77778 3.77913 5.77778C3.41068 5.77778 3.11246 5.47956 3.11246 5.11111ZM12.9267 10.8307L12.1582 14.0964C12.0165 14.6987 11.4791 15.1244 10.8605 15.1244H6.63824C6.2969 15.1244 5.9689 14.9938 5.72135 14.7591L3.26935 12.4356C2.54179 11.7462 2.46357 10.6351 3.08713 9.85067C3.4529 9.39067 4.00002 9.12667 4.58802 9.12667C4.83557 9.12667 5.07646 9.17333 5.3049 9.26578V5.56889C5.3049 4.46622 6.20224 3.56889 7.3049 3.56889C8.40757 3.56889 9.3049 4.46622 9.3049 5.56889V7.32222C9.38846 7.34933 9.46979 7.38267 9.54846 7.42222L11.8751 8.58578C12.7071 9.00178 13.1396 9.92489 12.9267 10.8307ZM11.2791 9.77822L8.95246 8.61467C8.8889 8.58267 8.82046 8.56756 8.75335 8.56756C8.6249 8.56756 8.49913 8.62267 8.41202 8.72578L8.08935 9.10845C8.08935 9.10845 8.04757 9.164 8.01424 9.164C7.99113 9.164 7.97202 9.13822 7.97202 9.052V5.56889C7.97202 5.20089 7.67335 4.90222 7.30535 4.90222C6.93735 4.90222 6.63868 5.20089 6.63868 5.56889V10.9996C6.63868 11.128 6.53335 11.2218 6.41646 11.2218C6.38579 11.2218 6.35424 11.2151 6.32357 11.2009L4.8329 10.5133C4.75424 10.4769 4.67113 10.4596 4.58846 10.4596C4.41468 10.4596 4.2449 10.5373 4.13113 10.68C3.94268 10.9169 3.96668 11.2587 4.18668 11.4671L6.63868 13.7907H10.8609L11.6293 10.5249C11.7 10.2249 11.5551 9.91556 11.2796 9.77778L11.2791 9.77822Z"/> | ||
| </svg> |
10 changes: 9 additions & 1 deletion
10
src/lib/IONOS/components/notifications/NotificationBanner.svelte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
src/lib/IONOS/components/notifications/PWAInstallDialog.svelte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| <script lang="ts"> | ||
| import type { Readable } from 'svelte/store'; | ||
| import type { I18Next } from '$lib/IONOS/i18next.d.ts'; | ||
| import Dialog from '$lib/IONOS/components/common/Dialog.svelte'; | ||
| import Touch from '$lib/IONOS/components/icons/Touch.svelte'; | ||
| import Share from '$lib/IONOS/components/icons/Share.svelte'; | ||
| import Button from '$lib/IONOS/components/common/Button.svelte'; | ||
| import { ButtonType } from '$lib/IONOS/components/common/buttons.ts'; | ||
| import { getContext } from 'svelte'; | ||
| import { createEventDispatcher } from 'svelte'; | ||
| import { isIOSDevice, isSafari } from '$lib/IONOS/services/pwa'; | ||
| import DialogHeader from '$lib/IONOS/components/common/DialogHeader.svelte'; | ||
|
|
||
| const i18n = getContext<Readable<I18Next>>('i18n'); | ||
| const dispatch = createEventDispatcher(); | ||
|
|
||
| export let show = false; | ||
|
|
||
| const showIOSInstructions = isIOSDevice() && isSafari(); | ||
|
|
||
| const handleInstall = () => { | ||
| dispatch('install'); | ||
| show = false; | ||
| }; | ||
|
|
||
| const handleLater = () => { | ||
| dispatch('close'); | ||
| show = false; | ||
| }; | ||
| </script> | ||
|
|
||
| <Dialog bind:show on:close={handleLater} | ||
| dialogId="pwa-install" | ||
| class="p-[30px] items-end md:items-center pb-[25px] px-[25px] max-md:mb-0 {show ? 'max-md:translate-y-[-5dvh]' : 'max-md:translate-y-[50dvh]'}" | ||
| animationDuration={150} | ||
| mobileCover={false} | ||
| externalClose={true} | ||
| > | ||
| <DialogHeader closable={false} slot="header" /> | ||
| <div slot="content" class="w-full "> | ||
| {#if showIOSInstructions} | ||
| <div class="text-center mb-6"> | ||
| <div class="w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4"> | ||
| <Touch className="w-8 h-8 text-blue-600" /> | ||
| </div> | ||
| <h3 class="text-xl font-semibold text-gray-900 mb-2"> | ||
| {$i18n.t('Install IONOS GPT', { ns: 'ionos' })} | ||
| </h3> | ||
| <p class="text-gray-600 mb-6"> | ||
| {$i18n.t('For quick and easy access, you can now install IONOS GPT like an app!', { ns: 'ionos' })} | ||
| </p> | ||
| </div> | ||
|
|
||
| <div class="flex flex-col justify-center space-y-4 mb-6"> | ||
| <div class="flex items-start space-x-3"> | ||
| <div class="flex-shrink-0 w-6 h-6 bg-blue-600 rounded-full flex items-center justify-center"> | ||
| <span class="text-white text-sm font-medium">1</span> | ||
| </div> | ||
| <div class="flex-1"> | ||
| <p class="text-gray-900"> | ||
| {$i18n.t('Tap the Share button', { ns: 'ionos' })} | ||
| <Share className="inline w-4 h-4 mx-1" /> | ||
| </p> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="flex items-start space-x-3"> | ||
| <div class="flex-shrink-0 w-6 h-6 bg-blue-600 rounded-full flex items-center justify-center"> | ||
| <span class="text-white text-sm font-medium">2</span> | ||
| </div> | ||
| <div class="flex-1 flex flex-row gap-1"> | ||
| <p class="text-gray-900"> | ||
| {$i18n.t('Select', { ns: 'ionos' })} | ||
| </p> | ||
| <p class="font-semibold">{$i18n.t('Add to Home Screen', { ns: 'ionos' })}</p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| {:else} | ||
| <div class="text-center mb-6"> | ||
| <div class="w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4"> | ||
| <Touch className="w-8 h-8 text-blue-600" /> | ||
| </div> | ||
| <h3 class="text-xl font-semibold text-gray-900 mb-2"> | ||
| {$i18n.t('Install IONOS GPT', { ns: 'ionos' })} | ||
| </h3> | ||
| <p class="text-gray-600 mb-6"> | ||
| {$i18n.t('For quick and easy access, you can now install IONOS GPT like an app!', { ns: 'ionos' })} | ||
| </p> | ||
| </div> | ||
|
|
||
| <div class="flex justify-center space-x-3"> | ||
| <Button | ||
| on:click={handleInstall} | ||
| type={ButtonType.primary} | ||
| className="transition-colors" | ||
| > | ||
| {$i18n.t('Install IONOS GPT', { ns: 'ionos' })} | ||
| </Button> | ||
| </div> | ||
| {/if} | ||
| </div> | ||
| </Dialog> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.