Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c160afe
feat: import snippets
louiswol94 Nov 27, 2025
41c9ba3
Update src/js/components/Import/FromFileUpload/components/ImportResul…
louiswol94 Dec 5, 2025
5f67617
Update src/js/components/Import/FromFileUpload/FileUploadForm.tsx
louiswol94 Dec 5, 2025
90f4f55
Update src/js/components/Import/FromFileUpload/FileUploadForm.tsx
louiswol94 Dec 5, 2025
840d553
Update src/js/components/Import/FromOtherPlugins/components/SimpleSni…
louiswol94 Dec 5, 2025
9b3c02e
Update src/js/components/Import/FromOtherPlugins/components/SimpleSni…
louiswol94 Dec 5, 2025
30d897b
Update src/js/components/Import/FromFileUpload/components/SnippetSele…
louiswol94 Dec 5, 2025
6a057c4
Update src/js/components/Import/FromFileUpload/components/DuplicateAc…
louiswol94 Dec 5, 2025
d7b01a2
Update src/js/components/Import/FromFileUpload/components/DuplicateAc…
louiswol94 Dec 5, 2025
c7e0e7c
Update src/js/components/Import/FromFileUpload/components/DuplicateAc…
louiswol94 Dec 5, 2025
5fe0328
Update src/js/components/Import/FromFileUpload/components/ImportResul…
louiswol94 Dec 5, 2025
56abcb5
Update src/js/components/Import/FromFileUpload/components/ImportResul…
louiswol94 Dec 5, 2025
900a0d8
Update src/js/components/Import/FromFileUpload/FileUploadForm.tsx
louiswol94 Dec 5, 2025
5bff754
Update src/js/components/Import/FromOtherPlugins/components/ImporterS…
louiswol94 Dec 5, 2025
bd6633a
Update src/js/components/Import/FromOtherPlugins/components/ImportOpt…
louiswol94 Dec 5, 2025
c6c200c
Update src/js/components/Import/FromOtherPlugins/components/StatusDis…
louiswol94 Dec 5, 2025
d46d38e
Update src/js/components/Import/shared/components/ImportSection.tsx
louiswol94 Dec 5, 2025
9c10716
Update src/js/components/Import/FromOtherPlugins/components/ImportOpt…
louiswol94 Dec 5, 2025
038cd9c
Update src/js/components/Import/FromOtherPlugins/components/SimpleSni…
louiswol94 Dec 5, 2025
8957440
Update src/js/components/Import/FromFileUpload/components/DragDropUpl…
louiswol94 Dec 5, 2025
048a978
Update src/js/components/Import/FromFileUpload/components/DragDropUpl…
louiswol94 Dec 5, 2025
943b28f
Update src/js/components/Import/FromFileUpload/components/DuplicateAc…
louiswol94 Dec 5, 2025
1eba64f
Update src/js/components/Import/FromFileUpload/components/SelectedFil…
louiswol94 Dec 5, 2025
9378b56
Update src/js/components/Import/FromFileUpload/FileUploadForm.tsx
louiswol94 Dec 5, 2025
094039c
Update src/js/components/Import/FromFileUpload/FileUploadForm.tsx
louiswol94 Dec 18, 2025
cb3b1c5
Update src/js/components/Import/FromFileUpload/FileUploadForm.tsx
louiswol94 Dec 18, 2025
9a82f55
Update src/js/components/Import/FromOtherPlugins/components/SimpleSni…
louiswol94 Dec 18, 2025
1b5d37f
Update src/js/components/Import/FromOtherPlugins/components/StatusDis…
louiswol94 Dec 18, 2025
ce9fe10
Update src/js/components/Import/FromOtherPlugins/ImportForm.tsx
louiswol94 Dec 18, 2025
6496b3d
Update src/js/components/Import/shared/components/ImportCard.tsx
louiswol94 Dec 18, 2025
f97ce32
Update src/js/components/Import/ImportApp.tsx
louiswol94 Dec 18, 2025
f13294f
Merge branch 'core-beta' into import-snippets
louiswol94 Dec 18, 2025
a65496c
Merge branch 'core-beta' into import-snippets
louiswol94 Dec 18, 2025
617cd8a
Merge branch 'import-snippets' of https://github.com/codesnippetspro/…
louiswol94 Dec 18, 2025
5f54960
Merge branch 'core-beta' into import-snippets
louiswol94 Jan 23, 2026
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
12 changes: 6 additions & 6 deletions src/js/components/Import/FromFileUpload/FileUploadForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const FileUploadForm: React.FC = () => {

<ImportCard>
<h2 style={{ margin: '0 0 1em 0' }}>{__('Choose Files', 'code-snippets')}</h2>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<h2 style={{ margin: '0 0 1em 0' }}>{__('Choose Files', 'code-snippets')}</h2>
<h2 style={{ margin: '0 0 1em' }}>{__('Choose Files', 'code-snippets')}</h2>

<p className="description" style={{ marginBottom: '1em' }}>
<p className="description" style={{ marginBlockEnd: '1em' }}>
{__('Choose one or more Code Snippets (.xml or .json) files to parse and preview.', 'code-snippets')}
</p>

Expand Down Expand Up @@ -133,20 +133,20 @@ export const FileUploadForm: React.FC = () => {

{currentStep === 'select' && importWorkflow.availableSnippets.length > 0 && !importWorkflow.uploadResult?.success && (
<ImportCard ref={selectSectionRef}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: '20px' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBlockEnd: '20px' }}>
<Button onClick={handleBackToUpload} className="button-link">
{__('← Upload Different Files', 'code-snippets')}
</Button>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '10px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBlockEnd: '10px' }}>
<div>
<h3 style={{ margin: '0' }}>{__('Available Snippets', 'code-snippets')} ({importWorkflow.availableSnippets.length})</h3>
<p style={{ margin: '0.5em 0 1em 0', color: '#666' }}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p style={{ margin: '0.5em 0 1em 0', color: '#666' }}>
<p style={{ margin: '0.5em 0 1em', color: '#666' }}>

{__('Select the snippets you want to import:', 'code-snippets')}
</p>
</div>
<div>
<Button onClick={snippetSelection.handleSelectAll} style={{ marginRight: '10px' }}>
<Button onClick={snippetSelection.handleSelectAll} style={{ marginInlineEnd: '10px' }}>
{snippetSelection.isAllSelected
? __('Deselect All', 'code-snippets')
: __('Select All', 'code-snippets')
Expand All @@ -172,8 +172,8 @@ export const FileUploadForm: React.FC = () => {
onSelectAll={snippetSelection.handleSelectAll}
/>

<div style={{ textAlign: 'end', marginTop: '1em' }}>
<Button onClick={snippetSelection.handleSelectAll} style={{ marginRight: '10px' }}>
<div style={{ textAlign: 'end', marginBlockStart: '1em' }}>
<Button onClick={snippetSelection.handleSelectAll} style={{ marginInlineEnd: '10px' }}>
{snippetSelection.isAllSelected
? __('Deselect All', 'code-snippets')
: __('Select All', 'code-snippets')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ export const DragDropUploadArea: React.FC<DragDropUploadAreaProps> = ({
textAlign: 'center',
cursor: disabled ? 'not-allowed' : 'pointer',
backgroundColor: dragOver ? '#f0f6fc' : disabled ? '#f6f7f7' : '#fafafa',
marginBottom: '20px',
marginBlockEnd: '20px',
transition: 'all 0.3s ease',
opacity: disabled ? 0.6 : 1
}}
>
<div style={{ fontSize: '48px', marginBottom: '10px', color: '#666' }}>📁</div>
<div style={{ fontSize: '48px', marginBlockEnd: '10px', color: '#666' }}>📁</div>
<p style={{ margin: '0 0 8px 0', fontSize: '16px', fontWeight: '500' }}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p style={{ margin: '0 0 8px 0', fontSize: '16px', fontWeight: '500' }}>
<p style={{ margin: '0 0 8px', fontSize: '16px', fontWeight: '500' }}>

{__('Drag and drop files here, or click to browse', 'code-snippets')}
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const DuplicateActionSelector: React.FC<DuplicateActionSelectorProps> = (
return (
<ImportCard>
<h2 style={{ margin: '0 0 1em 0' }}>{__('Duplicate Snippets', 'code-snippets')}</h2>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<h2 style={{ margin: '0 0 1em 0' }}>{__('Duplicate Snippets', 'code-snippets')}</h2>
<h2 style={{ margin: '0 0 1em' }}>{__('Duplicate Snippets', 'code-snippets')}</h2>

<p className="description" style={{ marginBottom: '1em' }}>
<p className="description" style={{ marginBlockEnd: '1em' }}>
{__('What should happen if an existing snippet is found with an identical name to an imported snippet?', 'code-snippets')}
</p>

Expand All @@ -29,7 +29,7 @@ export const DuplicateActionSelector: React.FC<DuplicateActionSelectorProps> = (
value="ignore"
checked={value === 'ignore'}
onChange={(e) => onChange(e.target.value as DuplicateAction)}
style={{ marginTop: '2px' }}
style={{ marginBlockStart: '2px' }}
/>
<span>
{__('Ignore any duplicate snippets: import all snippets from the file regardless and leave all existing snippets unchanged.', 'code-snippets')}
Expand All @@ -43,7 +43,7 @@ export const DuplicateActionSelector: React.FC<DuplicateActionSelectorProps> = (
value="replace"
checked={value === 'replace'}
onChange={(e) => onChange(e.target.value as DuplicateAction)}
style={{ marginTop: '2px' }}
style={{ marginBlockStart: '2px' }}
/>
<span>
{__('Replace any existing snippets with a newly imported snippet of the same name.', 'code-snippets')}
Expand All @@ -57,7 +57,7 @@ export const DuplicateActionSelector: React.FC<DuplicateActionSelectorProps> = (
value="skip"
checked={value === 'skip'}
onChange={(e) => onChange(e.target.value as DuplicateAction)}
style={{ marginTop: '2px' }}
style={{ marginBlockStart: '2px' }}
/>
<span>
{__('Do not import any duplicate snippets; leave all existing snippets unchanged.', 'code-snippets')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const ImportResultDisplay: React.FC<ImportResultDisplayProps> = ({ result
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0,
marginTop: '2px'
marginBlockStart: '2px'
}}>
<span style={{ color: 'white', fontSize: '14px', fontWeight: 'bold' }}>
{result.success ? '✓' : '✕'}
Expand Down Expand Up @@ -54,11 +54,11 @@ export const ImportResultDisplay: React.FC<ImportResultDisplayProps> = ({ result
)}

{result.warnings && result.warnings.length > 0 && (
<div style={{ marginTop: '12px' }}>
<div style={{ marginBlockStart: '12px' }}>
<h4 style={{ margin: '0 0 8px 0', fontSize: '14px', color: '#d63638' }}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<h4 style={{ margin: '0 0 8px 0', fontSize: '14px', color: '#d63638' }}>
<h4 style={{ margin: '0 0 8px', fontSize: '14px', color: '#d63638' }}>

{__('Warnings:', 'code-snippets')}
</h4>
<ul style={{ margin: '0', paddingLeft: '20px' }}>
<ul style={{ margin: '0', paddingInlineStart: '20px' }}>
{result.warnings.map((warning, index) => (
<li key={index} style={{ color: '#666', fontSize: '14px' }}>
{warning}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const SelectedFilesList: React.FC<SelectedFilesListProps> = ({
onRemoveFile
}) => {
return (
<div className="selected-files" style={{ marginBottom: '20px' }}>
<div className="selected-files" style={{ marginBlockEnd: '20px' }}>
<h3 style={{ margin: '0 0 12px 0', fontSize: '14px', fontWeight: '600' }}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<h3 style={{ margin: '0 0 12px 0', fontSize: '14px', fontWeight: '600' }}>
<h3 style={{ margin: '0 0 12px', fontSize: '14px', fontWeight: '600' }}>

{__('Selected Files:', 'code-snippets')} ({files.length})
</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const SnippetSelectionTable: React.FC<SnippetSelectionTableProps> = ({
<td>
<strong>{snippet.table_data.title}</strong>
{snippet.source_file && (
<div style={{ fontSize: '12px', color: '#666', marginTop: '2px' }}>
<div style={{ fontSize: '12px', color: '#666', marginBlockStart: '2px' }}>
from {snippet.source_file}
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Import/FromOtherPlugins/ImportForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const ImportForm: React.FC = () => {
snippetImport.importSuccess.length === 0 && (
<ImportCard>
<div style={{ textAlign: 'center', padding: '40px 20px', color: '#666' }}>
<div style={{ fontSize: '48px', marginBottom: '16px' }}>📭</div>
<div style={{ fontSize: '48px', marginBlockEnd: '16px' }}>📭</div>
<h3 style={{ margin: '0 0 8px 0', fontSize: '18px', color: '#333' }}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<h3 style={{ margin: '0 0 8px 0', fontSize: '18px', color: '#333' }}>
<h3 style={{ margin: '0 0 8px', fontSize: '18px', color: '#333' }}>

{__('No snippets found', 'code-snippets')}
</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const ImportOptions: React.FC<ImportOptionsProps> = ({
type="checkbox"
checked={autoAddTags}
onChange={(e) => onAutoAddTagsChange(e.target.checked)}
style={{ marginTop: '2px' }}
style={{ marginBlockStart: '2px' }}
/>
<div style={{ flex: 1 }}>
<div>
Expand All @@ -34,7 +34,7 @@ export const ImportOptions: React.FC<ImportOptionsProps> = ({
</span>
</div>
{autoAddTags && (
<div style={{ marginTop: '12px' }}>
<div style={{ marginBlockStart: '12px' }}>
<input
type="text"
value={tagValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const ImporterSelector: React.FC<ImporterSelectorProps> = ({
value={selectedImporter}
onChange={(event) => onImporterChange(event.target.value)}
className="regular-text"
style={{ display: 'block', marginTop: '5px', width: '100%', maxWidth: '300px' }}
style={{ display: 'block', marginBlockStart: '5px', width: '100%', maxWidth: '300px' }}
disabled={isLoading}
>
<option value="">{__('-- Select an importer --', 'code-snippets')}</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ export const SimpleSnippetTable: React.FC<SimpleSnippetTableProps> = ({

return (
<ImportCard className="snippets-table-container">
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '10px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBlockEnd: '10px' }}>
<div>
<h2 style={{ margin: '0' }}>{__('Available Snippets', 'code-snippets')} ({snippets.length})</h2>
<p style={{ margin: '0.5em 0 1em 0' }}>{__('We found the following snippets.', 'code-snippets')}</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p style={{ margin: '0.5em 0 1em 0' }}>{__('We found the following snippets.', 'code-snippets')}</p>
<p style={{ margin: '0.5em 0 1em' }}>{__('We found the following snippets.', 'code-snippets')}</p>

</div>
<div>
<Button onClick={onSelectAll} style={{ marginRight: '10px' }}>
<Button onClick={onSelectAll} style={{ marginInlineEnd: '10px' }}>
{isAllSelected
? __('Deselect All', 'code-snippets')
: __('Select All', 'code-snippets')
Expand Down Expand Up @@ -80,8 +80,8 @@ export const SimpleSnippetTable: React.FC<SimpleSnippetTableProps> = ({
</tbody>
</table>

<div style={{ textAlign: 'end', marginTop: '1em' }}>
<Button onClick={onSelectAll} style={{ marginRight: '10px' }}>
<div style={{ textAlign: 'end', marginBlockStart: '1em' }}>
<Button onClick={onSelectAll} style={{ marginInlineEnd: '10px' }}>
{isAllSelected
? __('Deselect All', 'code-snippets')
: __('Select All', 'code-snippets')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const StatusDisplay: React.FC<StatusDisplayProps> = ({
const isError = type === 'error'

return (
<ImportCard variant="controls" style={{ display: 'flex', alignItems: 'flex-start', gap: '12px', marginBottom: '20px' }}>
<ImportCard variant="controls" style={{ display: 'flex', alignItems: 'flex-start', gap: '12px', marginBlockEnd: '20px' }}>
<div style={{
backgroundColor: isError ? '#d63638' : '#00a32a',
borderRadius: '50%',
Expand All @@ -28,7 +28,7 @@ export const StatusDisplay: React.FC<StatusDisplayProps> = ({
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0,
marginTop: '2px'
marginBlockStart: '2px'
}}>
<span style={{ color: 'white', fontSize: '14px', fontWeight: 'bold' }}>
{isError ? '✕' : '✓'}
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Import/ImportApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const ImportApp: React.FC = () => {

return (
<div className="narrow" style={{ maxWidth: '800px' }}>
<h2 className="nav-tab-wrapper" style={{ marginBottom: '20px' }}>
<h2 className="nav-tab-wrapper" style={{ marginBlockEnd: '20px' }}>
<a
className={`nav-tab${activeTab === 'upload' ? ' nav-tab-active' : ''}`}
href="#"
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Import/shared/components/ImportCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const ImportCard = React.forwardRef<HTMLDivElement, ImportCardProps>(({
padding: '25px',
borderRadius: '5px',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
borderRadius: '5px',
borderRadius: '4px',

border: '1px solid #e0e0e0',
marginBottom: '10px',
marginBlockEnd: '10px',
width: '100%',
...style
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const ImportSection: React.FC<ImportSectionProps> = ({
}) => {
const sectionStyle: React.CSSProperties = {
display: active ? 'block' : 'none',
paddingTop: 0,
paddingBlockStart: 0,
...style
}

Expand Down
2 changes: 1 addition & 1 deletion src/php/class-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function load_plugin() {
// Importers.
new Plugins_Import_Manager();
new Files_Import_Manager();

// Initialize promotions.
new Promotions\Elementor_Pro();
}
Expand Down