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

Miscellaneous #106

Merged
merged 34 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
800da3b
Set up basic Motoko SSR API
rvanasa Jun 28, 2023
43568fd
Progress
rvanasa Jun 28, 2023
2b2277f
Implement helper function to find query param values
rvanasa Jun 28, 2023
06d0e1e
Progress
rvanasa Jun 28, 2023
c011533
Use 'Types.mo' file
rvanasa Jun 28, 2023
0419f1b
Fix URL query param key
rvanasa Jun 28, 2023
f65a1b6
XML progress
rvanasa Jun 28, 2023
0ef47b1
Validate URL
rvanasa Jun 28, 2023
cc46581
Improve XML text literal nesting
rvanasa Jun 28, 2023
dc269cb
Set up JSON format
rvanasa Jun 28, 2023
6387347
Adjust whitespace
rvanasa Jun 28, 2023
4770e88
Set up JSON
rvanasa Jun 28, 2023
9241cda
Progress
rvanasa Jun 28, 2023
1100bfa
Remove extra parentheses
rvanasa Jun 28, 2023
b3fe7e7
Add XML header and refactor caching
rvanasa Jun 28, 2023
7d6888d
Remove debug logic
rvanasa Jun 28, 2023
a3827b8
Use flexible memory for serialization
rvanasa Jun 28, 2023
627d836
Add space before iframe close for consistency with Netlify implementa…
rvanasa Jun 28, 2023
b432c76
Refactor to distinguish between XML strings and attributes
rvanasa Jun 28, 2023
2842def
Swap max with min in height calculation
rvanasa Jun 28, 2023
1cb8554
Change provider URL to embed.motoko.org
rvanasa Jun 28, 2023
0ee61ea
Fix height calculation logic
rvanasa Jun 28, 2023
6f70f0e
Rearrange width/height calculation logic for clarity
rvanasa Jun 28, 2023
0ad00db
Use stable memory for server cache
rvanasa Jun 28, 2023
6665310
Use default cache strategy
rvanasa Jun 28, 2023
5e26075
Use 'res.json()'
rvanasa Jun 28, 2023
228d882
Simplify
rvanasa Jun 28, 2023
2565275
Rearrange declarations
rvanasa Jun 28, 2023
31cd0d6
Bump 'motoko' npm package
rvanasa Jun 29, 2023
ae800ae
Remove server / certified cache logic
rvanasa Jul 1, 2023
22e20b7
Set up canister unit testing
rvanasa Jul 1, 2023
a5fd371
Use JSON output format by default
rvanasa Jul 19, 2023
3eadc04
Fix typo
rvanasa Jul 19, 2023
b4a7239
Merge branch 'main' of https://github.com/dfinity/embed-motoko into m…
rvanasa Jul 19, 2023
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
1 change: 1 addition & 0 deletions backend/Backend.mo
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ actor class Backend() {
let format : Types.Format = switch formatParam {
case (?"xml") #xml;
case (?"json") #json;
case null #json;
case _ return error("Invalid response format");
};

Expand Down
4 changes: 2 additions & 2 deletions src/components/CodeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ configureHighlightJS(hljs);

export const EDITOR_FONT_SIZE = isMobile() ? 14 : 16;

const hightlightWithLineNumbers = (input: string, language: string) => {
const highlightWithLineNumbers = (input: string, language: string) => {
return hljs
.highlight(input, { language })
.value.split('\n')
Expand Down Expand Up @@ -47,7 +47,7 @@ export default function CodeEditor({
placeholder="Write some Motoko..."
value={value}
onValueChange={(value) => onChange?.(value)}
highlight={(code) => hightlightWithLineNumbers(code, 'motoko')}
highlight={(code) => highlightWithLineNumbers(code, 'motoko')}
padding={10}
textareaClassName="code-area"
className="code-editor font-mono bg-white"
Expand Down