Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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: 5 additions & 5 deletions .github/workflows/issue-to-linear.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
const LINEAR_TOKEN = process.env.LINEAR_TOKEN;
const LINEAR_TEAM_ID = process.env.LINEAR_TEAM_ID;
const LINEAR_STATE_ID = process.env.LINEAR_STATE_ID;

const issue = context.payload.issue;

// Prepare the Linear issue creation query
const query = `
mutation IssueCreate($input: IssueCreateInput!) {
Expand All @@ -34,7 +34,7 @@ jobs:
}
}
`;

const variables = {
input: {
teamId: LINEAR_TEAM_ID,
Expand All @@ -43,7 +43,7 @@ jobs:
stateId: LINEAR_STATE_ID,
}
};

// Make the API request to Linear
try {
const response = await fetch('https://api.linear.app/graphql', {
Expand All @@ -66,4 +66,4 @@ jobs:

} catch (error) {
core.setFailed(`Action failed: ${error}`);
}
}
4 changes: 1 addition & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Pull-request to main

on:
pull_request:
branches: ["develop", "main"]
branches: ['develop', 'main']

jobs:
pre-commit:
Expand All @@ -23,5 +23,3 @@ jobs:
-H "X-GitHub-Api-Version: 2022-11-28" \
-d '{"ref": "main", "inputs": {"superdoc-branch": "${{ github.head_ref }}", "pull-request-url": "${{ github.event.pull_request.html_url }}"}}' \
${{ secrets.SD_TESTS_URL }}


2 changes: 1 addition & 1 deletion .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ on:

jobs:
pre-commit:
uses: ./.github/workflows/pre-commit.yml
uses: ./.github/workflows/pre-commit.yml
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"trailingComma": "all",
"bracketSameLine": false,
"useTabs": false
}
}
4 changes: 2 additions & 2 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function sidebar() {
{ text: 'Search', link: '/modules/#search' },
{ text: 'Fields', link: '/modules/#fields' },
{ text: 'Annotate', link: '/modules/#annotate' },
]
],
},
{
text: 'Resources',
Expand All @@ -116,4 +116,4 @@ function sidebar() {
},
],
};
}
}
6 changes: 3 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default [
__APP_VERSION__: 'readonly',
version: 'readonly',
superdoc: 'readonly',
}
},
},
rules: {
'no-unused-vars': 'warn', // See warnings but don't block
Expand All @@ -102,6 +102,6 @@ export default [
// Keep as warnings to address gradually
'no-unsafe-optional-chaining': 'warn', // Important but not critical
'no-unused-private-class-members': 'warn', // Clean up when refactoring
}
},
},
];
];
25 changes: 25 additions & 0 deletions packages/super-editor/src/core/super-converter/exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,31 @@ function generateParagraphProperties(node) {
pPrElements.push(sectPr);
}

// Add tab stops
const { tabStops } = attrs;
if (tabStops && tabStops.length > 0) {
const tabElements = tabStops.map((tab) => {
const tabAttributes = {
'w:val': tab.val || 'start',
'w:pos': pixelsToTwips(tab.pos).toString(),
};

if (tab.leader) {
tabAttributes['w:leader'] = tab.leader;
}

return {
name: 'w:tab',
attributes: tabAttributes,
};
});

pPrElements.push({
name: 'w:tabs',
elements: tabElements,
});
}

const numPr = node.attrs?.paragraphProperties?.elements?.find((n) => n.name === 'w:numPr');
const hasNumPr = pPrElements.some((n) => n.name === 'w:numPr');
if (numPr && !hasNumPr) pPrElements.push(numPr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,37 @@ export const handleParagraphNode = (params) => {

schemaNode.attrs['filename'] = filename;

// Parse tab stops
const tabs = pPr?.elements?.find((el) => el.name === 'w:tabs');
if (tabs && tabs.elements) {
const tabStops = tabs.elements
.filter((el) => el.name === 'w:tab')
.map((tab) => {
let val = tab.attributes['w:val'] || 'start';
// Test files continue to contain "left" and "right" rather than "start" and "end"
if (val == 'left') {
val = 'start';
} else if (val == 'right') {
val = 'end';
}
const tabStop = {
val,
pos: twipsToPixels(tab.attributes['w:pos']),
};

// Add leader if present
if (tab.attributes['w:leader']) {
tabStop.leader = tab.attributes['w:leader'];
}

return tabStop;
});

if (tabStops.length > 0) {
schemaNode.attrs.tabStops = tabStops;
}
}

// Normalize text nodes.
if (schemaNode && schemaNode.content) {
schemaNode = {
Expand Down
1 change: 1 addition & 0 deletions packages/super-editor/src/extensions/heading/heading.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const Heading = Node.create({
default: 1,
rendered: false,
},
tabStops: { rendered: false },
};
},

Expand Down
9 changes: 9 additions & 0 deletions packages/super-editor/src/extensions/paragraph/paragraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ export const Paragraph = Node.create({
return { style };
},
},
textCase: {
renderDOM: (attrs) => {
if (!attrs.textCase) return {};
return {
style: `text-transform: ${attrs.textCase}`,
};
},
},
tabStops: { rendered: false },
};
},

Expand Down
Loading
Loading