-
Notifications
You must be signed in to change notification settings - Fork 29
implement view pages #102
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
base: master
Are you sure you want to change the base?
implement view pages #102
Conversation
c98ca53
to
7ff5e71
Compare
// export the necessary contexts to enable rendering | ||
// datacore components outside the datacore plugin | ||
// itself | ||
get SETTINGS_CONTEXT(): typeof SETTINGS_CONTEXT { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I'd do it like this - it's better to expose hook functions which load this data instead (like dc.useSettings()
).
* Primarily intended to be used with `useAsync`. | ||
*/ | ||
public Suspend({ | ||
loaded: loaded, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Un-neccessary : loaded
.
@@ -52,6 +53,21 @@ export default class DatacorePlugin extends Plugin { | |||
-100 | |||
); | |||
|
|||
// Views: DatacoreJS view. | |||
// @ts-ignore be quiet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can this not be typed?
Added comments on the auxiliary pieces. |
4c324a6
to
60e3b70
Compare
…d `APP_CONTEXT` in the local api
…er file view (e.g., they can be dragged into the sidebar)
19d3049
to
8b3fd7b
Compare
to quote the roadmap:
each view page has its own state consisting of the following properties:
sourceType
: the type of script this view will contain (ex:ts
,js
,jsx
,tsx
...)script
: the actual source code for the scripttitle
: the title, as displayed in the tab/view headercurrentFile
: the configurable path to the current file, so that functions and hooks such asuseCurrentPath
don't chokeall of these are configurable via the view's settings page, which can be accessed via going into the three-dot menu and clicking "View configuration".
a command to create a view page has also been added to the command palette for ease of use.
as always, let me know if i should add or change anything! :)