Skip to content
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

♻️ Chore: Prep docs for new version #352

Merged
merged 132 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 129 commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
cb851d1
Create draft PR for #351
create-issue-branch[bot] Oct 8, 2024
330d87e
Merge branch 'issue-0304' into issue-0351
Adammatthiesen Oct 8, 2024
db72b47
Merge branch 'issue-0304' into issue-0351
Adammatthiesen Oct 8, 2024
6dc565e
version and prep docs
Adammatthiesen Oct 8, 2024
86b8b22
Style adjustments to docs
louisescher Oct 8, 2024
dae98cd
Revert text change
TheOtterlord Oct 8, 2024
c0cbf25
update og images to conform to twitter guidelines
Adammatthiesen Oct 8, 2024
898d53b
Merge branch 'issue-0304' into issue-0351
Adammatthiesen Oct 9, 2024
b62fcda
Merge branch 'issue-0304' into issue-0351
Adammatthiesen Oct 10, 2024
d8dc8f3
update lockfile
Adammatthiesen Oct 10, 2024
5f1b968
fix lint errors
Adammatthiesen Oct 10, 2024
f362a68
Merge branch 'issue-0304' into issue-0351
Adammatthiesen Oct 10, 2024
b66e2ce
refactor docs to cleanup the whole thing
Adammatthiesen Oct 10, 2024
161551a
remove now unneeded package
Adammatthiesen Oct 10, 2024
acaacc0
update typedoc config
Adammatthiesen Oct 10, 2024
daaa011
dep cleanup
Adammatthiesen Oct 10, 2024
54d754a
Refactor Integration.astro to display "N/A" for unreleased packages
Adammatthiesen Oct 10, 2024
460411c
update pageTitle to support integrations
Adammatthiesen Oct 10, 2024
4e82af9
add sponsors section
Adammatthiesen Oct 10, 2024
89b6a05
up
Adammatthiesen Oct 10, 2024
3a4930e
Refactor Sponsors.astro to add target and rel attributes to sponsor link
Adammatthiesen Oct 10, 2024
92f8281
Update sidebar label
Adammatthiesen Oct 10, 2024
5d39a2b
Refactor Integration.astro to add support for plugins
Adammatthiesen Oct 10, 2024
80bf11c
add note to styles
Adammatthiesen Oct 10, 2024
a5ec183
update label
Adammatthiesen Oct 10, 2024
aa0283c
Refactor Astro config to add support for @studiocms/blog plugin
Adammatthiesen Oct 10, 2024
f6a5238
fix
Adammatthiesen Oct 10, 2024
a1d3351
Refactor Astro config to remove isScoped and scope properties
Adammatthiesen Oct 10, 2024
28d9263
Refactor Astro config to remove unused code and improve package name …
Adammatthiesen Oct 10, 2024
e5df7ec
Refactor Sponsors component styles to center align links and headings
Adammatthiesen Oct 10, 2024
def63cb
fix icon
Adammatthiesen Oct 11, 2024
f5fdb70
Refactor packagecatalog config to remove extra code and improve packa…
Adammatthiesen Oct 12, 2024
867ec25
fix config reference
Adammatthiesen Oct 12, 2024
2729016
Refactor PackageCatalog component to filter and sort packages based o…
Adammatthiesen Oct 12, 2024
aff939e
Refactor PackageCatalog component to use 'catalog' prop instead of 'p…
Adammatthiesen Oct 12, 2024
7d430d6
Refactor Astro.props in Integration.astro to include publiclyUsable prop
Adammatthiesen Oct 13, 2024
a624bff
Refactor config.ts to include redirectSchema
Adammatthiesen Oct 13, 2024
92b2fe2
refactor
Adammatthiesen Oct 13, 2024
6fc2db2
Refactor Astro.config.mts to include @shikijs/twoslash integration
Adammatthiesen Oct 13, 2024
62ec224
Refactor Astro.config.mts to use StudioCMSOptions instead of StudioCM…
Adammatthiesen Oct 13, 2024
e035bdf
Dashboard additions removals (#354)
louisescher Oct 14, 2024
48fb8e9
Merge branch 'issue-0304' into issue-0351
Adammatthiesen Oct 14, 2024
f11a218
start of adding transformers and their css
Adammatthiesen Oct 14, 2024
e2303f9
more twoslash!
Adammatthiesen Oct 14, 2024
16ed0ee
Update '@astrojs/starlight' version to 0.28.3
Adammatthiesen Oct 14, 2024
e7878e0
Update dependencies for '@astrojs/starlight', '@astrojs/db', '@astroj…
Adammatthiesen Oct 14, 2024
693c667
test
Adammatthiesen Oct 14, 2024
79bff7b
apply fix
Adammatthiesen Oct 14, 2024
cf8af50
update docs and re-enable astro check
Adammatthiesen Oct 14, 2024
da89a2a
Update configuration.mdx with link to reference pages
Adammatthiesen Oct 14, 2024
b37ca5a
Add description for StudioCMS DevApps
Adammatthiesen Oct 14, 2024
98458aa
Refactor StudioCMS package.json exports
Adammatthiesen Oct 14, 2024
7f318ad
more progress
Adammatthiesen Oct 14, 2024
df01324
Update Astro version to 4.16.3 and adjust button position in custom.css
Adammatthiesen Oct 14, 2024
b32364e
update default bracketPairs comment
Adammatthiesen Oct 14, 2024
3c40c9a
update to conform to new astro docs and update other links
Adammatthiesen Oct 14, 2024
d95b0a4
add ts-nocheck to prevent warnings/errors for shiki transformer
Adammatthiesen Oct 14, 2024
d69d8f3
revert
Adammatthiesen Oct 14, 2024
f0470ea
new title transformer for shiki
Adammatthiesen Oct 14, 2024
19710be
add titles
Adammatthiesen Oct 14, 2024
5296a8d
cleanup
Adammatthiesen Oct 14, 2024
07de55f
update demo link in code snippet
Adammatthiesen Oct 14, 2024
6a3beb4
Update custom.css styles for code snippets
Adammatthiesen Oct 14, 2024
e25cbe4
Update studiocms/src/index.ts and www/docs/src/content/docs/config-re…
Adammatthiesen Oct 14, 2024
ecc01c1
Refactor import statement in defineStudioCMSConfig.ts
Adammatthiesen Oct 14, 2024
13bd41d
fix the TS error that was being caused by a `.` instead of a `,`
Adammatthiesen Oct 14, 2024
041d35f
some css styling for the copy button
Adammatthiesen Oct 14, 2024
aec44e8
update css
Adammatthiesen Oct 14, 2024
a590ff1
Update custom.css with new color tokens and styling for highlighted w…
Adammatthiesen Oct 14, 2024
70984f2
remove spacing
Adammatthiesen Oct 14, 2024
3705cef
Update custom.css to add background color for highlighted words and d…
Adammatthiesen Oct 14, 2024
5782190
Update custom.css to adjust background colors for highlighted words a…
Adammatthiesen Oct 14, 2024
bd1d43b
fixed css
Adammatthiesen Oct 14, 2024
242b3b5
Update custom.css to remove inline-block display for diff spans
Adammatthiesen Oct 14, 2024
ac51438
Remove test comment, fix copy SVGs, color changes
louisescher Oct 14, 2024
37ba009
Add image zoom, remove carousel, adjust hero buttons
louisescher Oct 14, 2024
35c5c8d
refactor css file into multiple files
Adammatthiesen Oct 14, 2024
c6eb9c2
Refactor shiki transformers and update import paths
Adammatthiesen Oct 14, 2024
234527b
Refactor Docs landing page
Adammatthiesen Oct 15, 2024
eca73a1
Refactor SplitCard component CSS
Adammatthiesen Oct 15, 2024
522bf11
Refactor Youtube.astro component CSS
Adammatthiesen Oct 15, 2024
2659667
Refactor why-studioCMS.mdx file
Adammatthiesen Oct 15, 2024
9009a49
Refactor card CSS to include all the cards from starlight
Adammatthiesen Oct 15, 2024
7c9889a
Refactor index.mdx to include instructions for setting up Turso database
Adammatthiesen Oct 15, 2024
9b85e27
Refactor Getting started guide and remove unused components
Adammatthiesen Oct 15, 2024
f7061ff
Refactor getting started guide
Adammatthiesen Oct 15, 2024
19cb000
Refactor config references
Adammatthiesen Oct 15, 2024
d553ab3
Refactor config references and add Renderer type
Adammatthiesen Oct 15, 2024
7017a65
Refactor StudioCMS custom renderer documentation to include informati…
Adammatthiesen Oct 15, 2024
ec04fe7
cleanup docs
Adammatthiesen Oct 15, 2024
2b03a94
Refactor environment variable documentation and add ReadMore component
Adammatthiesen Oct 15, 2024
84dbdc1
Refactor YouTube and landing card components
Adammatthiesen Oct 15, 2024
4565600
Refactor Discord button styling in index.mdx and starlight.css
Adammatthiesen Oct 15, 2024
50d22a3
Refactor starlight.css: Add gap to LinkButton button styling
Adammatthiesen Oct 15, 2024
35ad52c
fix
Adammatthiesen Oct 15, 2024
e22d9df
Refactor SplitCard component: Add padding to split container
Adammatthiesen Oct 15, 2024
977b1a5
Refactor SplitCard component: Remove unnecessary padding in split con…
Adammatthiesen Oct 15, 2024
0316d33
Refactor landing page: Update StudioCMS card icon
Adammatthiesen Oct 15, 2024
cd56b60
Custom head component to preload the fonts
Adammatthiesen Oct 15, 2024
014fc20
Add new component for planned Contributor guide page
Adammatthiesen Oct 15, 2024
e0658af
Update sidebar component name, and update SiteTitle component
Adammatthiesen Oct 15, 2024
f0fc87a
Update astro.config.mts: Add 'x.com' link to StudioCMS social media
Adammatthiesen Oct 15, 2024
edd5f9a
Contributing guide!
Adammatthiesen Oct 15, 2024
10a021b
Update astro.config.mts: Add remotePatterns for images
Adammatthiesen Oct 15, 2024
b842153
Update FacePile component: Adjust avatar size and alignment
Adammatthiesen Oct 15, 2024
e74faad
Update contributing guide
Adammatthiesen Oct 15, 2024
f0c4fa3
Update contributing guide: Add link to contributing guide in README.md
Adammatthiesen Oct 15, 2024
d3c8ff1
Update astro.config.mts: Add badge to @studiocms/ui label
Adammatthiesen Oct 16, 2024
9938e57
Update contributing guide: Update link to contributors list in contri…
Adammatthiesen Oct 16, 2024
a699bda
Update dependencies: Add hast-util-to-string, html-escaper, rehype-sl…
Adammatthiesen Oct 16, 2024
34ec6cd
Update anchor link icon style
Adammatthiesen Oct 16, 2024
872b66c
Update anchor link icon style and display of content elements
Adammatthiesen Oct 16, 2024
09d6232
Update dependencies: Add shiki-transformer-color-highlight and unified
Adammatthiesen Oct 16, 2024
febf536
Update contributor list component and styles
Adammatthiesen Oct 16, 2024
98a71e6
Refactor getContributorsByPath function to remove ignored commit keyw…
Adammatthiesen Oct 16, 2024
d212a53
cleanup
Adammatthiesen Oct 16, 2024
9bbb0a3
Update external link icon and remove underline from anchor links
Adammatthiesen Oct 16, 2024
9a48ea8
Update SiteTitle.astro
louisescher Oct 16, 2024
367a541
Add bun as a package manager option
louisescher Oct 16, 2024
b0e2c76
Refactor getContributorsByPath function to improve author handling an…
Adammatthiesen Oct 17, 2024
777f6f4
Refactor TursoCLI command builder for improved handling of authentica…
Adammatthiesen Oct 17, 2024
90440e8
Refactor to use dynamic sponsor links
Adammatthiesen Oct 17, 2024
aae4d48
Update strings.ts
Adammatthiesen Oct 18, 2024
3f4b7b5
Update why-studioCMS.mdx
louisescher Oct 19, 2024
a3124a1
Feat(devapps): Wordpress Importer (#360)
Adammatthiesen Oct 19, 2024
4a01142
Update www/docs/src/content/docs/start-here/why-studioCMS.mdx
louisescher Oct 19, 2024
336b141
Update www/docs/src/content/docs/start-here/why-studioCMS.mdx
louisescher Oct 19, 2024
54d4175
Update www/docs/src/content/docs/start-here/why-studioCMS.mdx
louisescher Oct 19, 2024
0390123
Update www/docs/src/content/docs/start-here/why-studioCMS.mdx
louisescher Oct 19, 2024
34b4ea9
Update title in how-it-works/index.mdx
Adammatthiesen Oct 19, 2024
69d5dea
Fix twoslash popups overflowing parent container
louisescher Oct 19, 2024
c4ba95f
Merge branch 'issue-0351' of https://github.com/astrolicious/studiocm…
louisescher Oct 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/curvy-mirrors-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@studiocms/ui": patch
---

Applied various changes and fixes to different parts of the UI libary.

- Fixed a CSS leak caused by importing css files instead of having scoped styles
- Adjusted dropdown helper API for better DX
- Adjusted modal helper API for better DX
- Various CSS fixes for different components
5 changes: 5 additions & 0 deletions .changeset/metal-steaks-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@studiocms/devapps": patch
---

[Feat]: Add Wordpress importer app
7 changes: 7 additions & 0 deletions .changeset/thin-hounds-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@studiocms/dashboard": patch
"@studiocms/core": patch
"studiocms": patch
---

Adjusted strings to account for Astro Studio sunsetting
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
"editor.defaultFormatter": "biomejs.biome"
"editor.defaultFormatter": "biomejs.biome",
"[mdx]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
24 changes: 1 addition & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,7 @@ To see how to get started, check out the [StudioCMS README](./packages/studiocms

## Contributing

We welcome contributions from the community! Whether it's bug reports, feature requests, or code contributions, we appreciate your help in making this project better.

### Bug Reports and Feature Requests

If you encounter any bugs or have ideas for new features, please open an issue on our [GitHub repository](https://github.com/astrolicious/studiocms). When creating a new issue, please provide as much detail as possible, including steps to reproduce the issue (for bugs) and a clear description of the proposed feature.

### Code Contributions

If you'd like to contribute code to this project, please follow these steps:

1. Fork the repository and create a new branch for your contribution.
2. Make your changes and ensure that the code follows our coding conventions and style guidelines.
3. Write tests for your changes, if applicable.
4. Update the documentation, if necessary.
5. Commit your changes and push them to your forked repository.
6. Open a pull request against the main repository, providing a clear description of your changes and their purpose.

We will review your contribution as soon as possible and provide feedback or merge it into the main codebase if everything looks good.

Please note that by contributing to this project, you agree to our [Code of Conduct](https://github.com/astrolicious/.github/blob/main/.github/CODE_OF_CONDUCT.md).

Thank you for your interest in contributing to this project!
We welcome contributions from the community! Whether it's bug reports, feature requests, or code contributions, we appreciate your help in making this project better. To get started read our [Contributing Guide](https://docs.studiocms.xyz/start-here/contributing/)

## Chat with Us

Expand Down Expand Up @@ -80,7 +59,6 @@ Steps to get a running playground should be the following:
Commands to run:

- `pnpm playground:login` - Login your CLI to Astro Studio
- `pnpm playground:link` - Link to Astro Studio and Create a new DB for your CMS Installation
- `pnpm playground:push` - Creates the base tables on the remote database.
- `pnpm playground:dev` - Starts the Dev server connected to the linked database

Expand Down
5 changes: 4 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
"linter": {
"enabled": true,
"rules": {
"recommended": true
"recommended": true,
"suspicious": {
"noExplicitAny": "warn"
}
}
},
"overrides": [
Expand Down
14 changes: 8 additions & 6 deletions packages/studiocms/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
import { defineStudioCMSConfig, defineStudioCMSPlugin } from '@studiocms/core/lib';
import type { CustomRenderer, Renderer, StudioCMSOptions } from '@studiocms/core/schemas';
import type { StudioCMSPluginOptions } from '@studiocms/core/types';
import integration from './integration';

/**
* # Astro Studio CMS Integration
* **StudioCMS Integration**
*
* A CMS built for Astro by the Astro Community for the Astro Community.
*
* Checkout our [GitHub Repo `@astrolicious/studiocms`](https://github.com/astrolicious/studiocms)
*
* Check out [Astro-StudioCMS.xyz](https://astro-studiocms.xyz) or the Built-in JSDocs *(Hover Docs like this)* for more information.
*
* > **Note: Astro SSR adapters that are configured for Image Optimization will automatically take full control of the Image Optimization Service. Making the `imageService` option in this integration not have any effect.**
*
* @see [GitHub Repo: 'astrolicious/studiocms'](https://github.com/astrolicious/studiocms) for more information on how to contribute to StudioCMS.
* @see [StudioCMS Docs](https://docs.studiocms.xyz) for more information on how to use StudioCMS.
*
*/
export const studioCMS = integration;

export default studioCMS;

// Config Utility
export { defineStudioCMSConfig };
export { defineStudioCMSConfig, type StudioCMSOptions };

// Plugin System
export { defineStudioCMSPlugin, type StudioCMSPluginOptions };

export type { CustomRenderer, Renderer };
9 changes: 6 additions & 3 deletions packages/studiocms_blog/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ const studioCMSBlogTheme = defineTheme({
export type ATP_ThemeOptions = Parameters<typeof studioCMSBlogTheme>[0];

/**
* # StudioCMS Blog Theme(Integration)
* #### Powered by [`astro-theme-provider`](https://github.com/astrolicious/astro-theme-provider) by [Bryce Russell](https://github.com/BryceRussell)
* **StudioCMS Blog Theme(Integration)**
*
* **Powered by [`astro-theme-provider`](https://github.com/astrolicious/astro-theme-provider) by [Bryce Russell](https://github.com/BryceRussell)**
*
* This theme provides a Blog Index Page and RSS Feed for your StudioCMS Site as well as route handling for Blog Posts.
*
* @example
* ```js
* import { defineConfig } from 'astro/config';
* import db from '@astrojs/db';
* import studioCMS from 'studiocms';
Expand All @@ -41,8 +43,9 @@ export type ATP_ThemeOptions = Parameters<typeof studioCMSBlogTheme>[0];
* }),
* ],
* });
* ```
*/
export function studioCMSBlog(options: ATP_ThemeOptions) {
export function studioCMSBlog(options?: ATP_ThemeOptions) {
let slug: string;

if (typeof options?.pages?.['/blog'] === 'string') {
Expand Down
2 changes: 1 addition & 1 deletion packages/studiocms_core/src/components/Avatar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const { isLoggedIn, dbUser: userProfile } = Astro.locals;
))
}
{ enabled === false && (
<a href="#" aria-disabled="true" title="Please Edit your Database through your Studio Dashboard">
<a href="#" aria-disabled="true" title="Please Edit your database through your provider's dashboard">
<img
src={profileImg.src}
alt="Authentication Disabled"
Expand Down
2 changes: 1 addition & 1 deletion packages/studiocms_core/src/lib/defineStudioCMSConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type { StudioCMSOptions } from '../schemas';
* @example
* ```js
* // studiocms.config.mjs
* import { defineStudioCMSConfig } from '@astrolicious/studiocms';
* import { defineStudioCMSConfig } from 'studiocms';
*
* export default defineStudioCMSConfig({
* dbStartPage: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/studiocms_core/src/schemas/config/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { unocssConfigSchema } from './unocss';
export const dashboardConfigSchema = z
.object({
/**
* OPTIONAL - This allows the user to enable or disable the Astro Studio CMS Dashboard but still provide all the helper's and utilities to those who are customizing their setup, doing so will disable the dashboard and you will need to manage your content via the Astro Studio Dashboard at http://studio.astro.build
* OPTIONAL - This allows the user to enable or disable the Astro StudioCMS dashboard but still provide all the helper's and utilities to those who are customizing their setup, doing so will disable the dashboard and you will need to manage your content via your database
*
* @default true
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/studiocms_core/src/schemas/config/developer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const developerConfigSchema = z
/**
* Enable Testing and Demo Mode
*
* This will enable the testing and demo mode for the Astro Studio CMS Dashboard, this will allow you to test the dashboard without having to authenticate. This is useful for testing and demo purposes as it will allow you to see how the dashboard works and looks but disable any changes to the database.
* This will enable the testing and demo mode for the Astro StudioCMS dashboard, this will allow you to test the dashboard without having to authenticate. This is useful for testing and demo purposes as it will allow you to see how the dashboard works and looks but disable any changes to the database.
Adammatthiesen marked this conversation as resolved.
Show resolved Hide resolved
*
* @default false
*/
Expand Down
16 changes: 13 additions & 3 deletions packages/studiocms_core/src/schemas/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@ import { dashboardConfigSchema } from './dashboard';
import { DefaultFrontEndConfigSchema } from './defaultFrontend';
import { imageServiceSchema } from './imageService';
import { includedIntegrationsSchema } from './integrations';
import { type StudioCMSRendererConfig, StudioCMSRendererConfigSchema } from './rendererConfig';
import {
type CustomRenderer,
type Renderer,
type StudioCMSRendererConfig,
StudioCMSRendererConfigSchema,
} from './rendererConfig';

//
// Exported Schemas for use in other internal packages
//
export { StudioCMSRendererConfigSchema, type StudioCMSRendererConfig };
export {
StudioCMSRendererConfigSchema,
type StudioCMSRendererConfig,
type CustomRenderer,
type Renderer,
};
export { dashboardConfigSchema, DefaultFrontEndConfigSchema, imageServiceSchema, overridesSchema };

//
Expand Down Expand Up @@ -64,4 +74,4 @@ export const StudioCMSOptionsSchema = z
.optional()
.default({});

export type StudioCMSOptions = z.infer<typeof StudioCMSOptionsSchema>;
export type StudioCMSOptions = typeof StudioCMSOptionsSchema._input;
14 changes: 14 additions & 0 deletions packages/studiocms_core/src/schemas/config/rendererConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ import { mdxConfigSchema } from './mdx';
export type Renderer = (content: string) => Promise<string>;
export type { markdocRenderer };

/**
* Custom Renderer Type
* @description A custom renderer that can be used in StudioCMS
* @property {string} name - The name of the renderer
* @property {Renderer} renderer - The renderer function
* @example
* ```ts
* const customRenderer: CustomRenderer = {
* name: 'custom',
* renderer: async (content: string) => {
* return content;
* },
* };
*/
export type CustomRenderer = {
name: string;
renderer: Renderer;
Expand Down
8 changes: 4 additions & 4 deletions packages/studiocms_core/src/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export const CoreStrings = {
};

export const DbErrors = {
AstroConfigOutput: "Astro Studio CMS is only supported in 'Output: server' SSR mode.",
AstroConfigOutput: "StudioCMS is only supported in 'Output: server' SSR mode.",
AstroConfigSiteURL:
"Astro Studio CMS requires a 'site' configuration in your Astro Config. This can be your domain ( 'https://example.com' ) or localhost ( 'http://localhost:4321' - localhost should only be used during development and should not be used in production).",
"StudioCMS requires a 'site' configuration in your Astro Config. This can be your domain ( 'https://example.com' ) or localhost ( 'http://localhost:4321' - localhost should only be used during development and should not be used in production).",
DbStartPage:
'Start Page is Enabled. This will be the only page available until you initialize your database and disable the config option forcing this page to be displayed. To get started, visit http://localhost:4321/start/ in your browser to initialize your database. And Setup your installation.',
astroDbMissingMessage: 'Astro DB Integration not found in Astro Config',
Expand Down Expand Up @@ -39,10 +39,10 @@ export const DashboardStrings = {
Setup: 'Setting up StudioCMS Dashboard...',
AddIntegrations: 'Adding Dashboard Integrations...',
TestAndDemo:
'Testing and Demo Mode is Enabled, Authentication will not be required to access dashboard pages. But you will only be able to edit the database from the Astro Studio Dashboard, https://studio.astro.build/',
'Testing and Demo Mode is Enabled, Authentication will not be required to access dashboard pages. But you will only be able to edit the database directly',
AuthEnabled: 'Auth is Enabled, Setting Up...',
AuthDisabled:
'Auth is Disabled by the User Configuration. You will only be able to edit the database from the Astro Studio Dashboard, https://studio.astro.build/',
'Auth is Disabled by the User Configuration. You will only be able to edit the database directly',
AuthRoutes: 'Setting up Auth Routes...',
DashboardEnabled: 'Dashboard is Enabled.',
DashboardDisabled:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ if (permissionLevel !== 'admin') {

<div class="py-2">
<span>
Note: To delete admins you can do this from your Astro Studio Dashboard.
Note: To delete admins you can do this from your database.
</span>
</div>

Expand Down
14 changes: 14 additions & 0 deletions packages/studiocms_devapps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@ The following env variables set (`@astrojs/db`):

![pageview](./assets/preview-page.png)

### WordPress Importer

#### Requires

- StudioCMS Integration
- A current WP Install
- `@studiocms/blog` (Optional for importing Posts under a blog)

#### Preview

- Toolbar app

![WP-importer](./assets/wp-importer.png)

## Licensing

[MIT Licensed](https://github.com/astrolicious/studiocms/blob/main/LICENSE).
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions packages/studiocms_devapps/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,17 @@ declare module 'virtual:studiocms-devapps/libsql-viewer' {
};
export default value;
}

declare module 'virtual:studiocms-devapps/wp-api/configPath' {
const value: {
readonly projectRoot: string;
};
export default value;
}

declare module 'virtual:studiocms-devapps/wp-api-importer' {
const value: {
readonly endpointPath: string;
};
export default value;
}
8 changes: 7 additions & 1 deletion packages/studiocms_devapps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@
},
"type": "module",
"dependencies": {
"@studiocms/core": "workspace:*",
"@libsql/client": "^0.14.0",
"astro-integration-kit": "catalog:"
"astro-integration-kit": "catalog:",
"cheerio": "^1.0.0",
"@types/cheerio": "^0.22.35",
"turndown": "^7.2.0",
"@types/turndown": "^5.0.5",
"html-entities": "^2.5.2"
},
"peerDependencies": {
"@astrojs/db": "catalog:min",
Expand Down
5 changes: 4 additions & 1 deletion packages/studiocms_devapps/src/apps/libsqlViewer.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import config from 'virtual:studiocms-devapps/libsql-viewer';
import { defineToolbarApp } from 'astro/toolbar';
import { closeOnOutsideClick } from './utils';

export default defineToolbarApp({
init(canvas) {
init(canvas, eventTarget) {
const appWindow = document.createElement('astro-dev-toolbar-window');
appWindow.style.width = '95%';
appWindow.style.height = '80vh';

closeOnOutsideClick(eventTarget);

const link = document.createElement('a');
link.href = config.endpointPath;
link.target = '_blank';
Expand Down
42 changes: 42 additions & 0 deletions packages/studiocms_devapps/src/apps/utils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
export function createWindowElement(content: string) {
const windowElement = document.createElement('astro-dev-toolbar-window');
windowElement.innerHTML = content;
windowElement.placement = 'bottom-center';
return windowElement;
}

export function closeOnOutsideClick(
eventTarget: EventTarget,
additionalCheck?: (target: Element) => boolean
) {
interface AppToggledEventDetail {
state: boolean;
}

const isCustomEvent = (event: Event): event is CustomEvent<AppToggledEventDetail> => {
return 'detail' in event;
};

function onPageClick(event: MouseEvent) {
const target = event.target as Element | null;
if (!target) return;
if (!target.closest) return;
if (target.closest('astro-dev-toolbar')) return;
if (additionalCheck?.(target)) return;
eventTarget.dispatchEvent(
new CustomEvent('toggle-app', {
detail: {
state: false,
},
})
);
}
eventTarget.addEventListener('app-toggled', (event: Event) => {
if (!isCustomEvent(event)) return;
if (event.detail.state === true) {
document.addEventListener('click', onPageClick, true);
} else {
document.removeEventListener('click', onPageClick, true);
}
});
}
Loading